Skip to content

Latest commit

 

History

History
79 lines (62 loc) · 3.47 KB

multitrack.md

File metadata and controls

79 lines (62 loc) · 3.47 KB

multitrack.sh

Revision: 1 Last modified: 2026-12-04T17:00:00Z Authority: constitution §11.4.167 / §11.4.21 / §11.4.101 / §11.4.119 / §11.4.133 / §11.4.6 Scope: §11.4.18 companion doc for constitution/scripts/multitrack/multitrack.sh

Overview

multitrack.sh is the top-level entry point of the multi-track engine. It deliberately implements no mechanism of its own: it binds three already-built siblings into one command surface — multitrack_config.sh (host/config resolution + track enumeration), multitrack_registry.sh (the .ws_state/streams.tsv accessor) and multitrack_device_lock.sh (the device arbiter).

It operates on the software layer only. It probes (read-only) whether each track's drive is mounted, reports the registry row and the device-lock pool state, and when a track's LUKS2 drive is not mounted it reports OPERATOR-BLOCKED honestly instead of attempting a mount. Mounting needs the operator's su + passphrase; §11.4.133 forbids autonomous mount/format, and this script never crosses that line.

Prerequisites

  • bash, awk, and the three sibling scripts in the same directory (a missing sibling is exit 1, not a silent degrade).
  • config/multitrack/<hostname>.yaml resolvable through multitrack_config.sh, or an explicit MT_CONFIG. A config that cannot be resolved/parsed is exit 1.
  • /proc/self/mounts readable — that is the live mount probe. There is no findmnt dependency here.

Usage

multitrack.sh status     # read-only report
multitrack.sh up         # preflight / reconcile
multitrack.sh help

There are exactly three subcommands. Anything else is a usage error (exit 2).

Exit codes

Code Meaning
0 status: the report printed (blocked tracks are DATA, not a failure). up: every track is live-mounted.
2 usage error (unknown or missing subcommand).
20 up only — OPERATOR-BLOCKED: at least one track needs an operator mount. This is the deliberate non-zero, not a crash.
1 internal error (config unresolvable, sibling script missing).

Edge cases and failure modes

  • status never fails on a blocked track. Its exit 0 is a report verdict, not a "everything is healthy" claim. Read the table.
  • up exit 20 is not a defect. It is the §11.4.21 honest operator hand-off. A CI job that treats 20 as a build failure will mis-fire on any host whose LUKS drives are not mounted.
  • up may rewrite the registry (atomically, via multitrack_registry.sh set) when, and only when, the live mount state differs from the recorded state. On an all-unmounted host it is a no-op.
  • The script never mounts, unmounts or formats anything. If you expected a drive to be brought up by up, it will not be — read the operator note it prints.

Related scripts

Last verified

2026-12-04 — header block, subcommand dispatch (status / up / help) and the 20 OPERATOR-BLOCKED path re-read from the working tree.