After Dark Systems / Service Automation HubCompletely Programmable Infrastructure

OpenSAH / Host init guides

sahinit commands, files and codes.

Every command and flag, every file sahinit reads or writes with its ownership rules, the control protocol, and every refusal and diagnostic code with what to do about it.

Early development PID 1 experimental No packaged releases GPL-3.0-or-later

This guide: sahinit guide · Unit reference · Commands, files & codes

Command-line reference

This page lists every sahinit command and flag. It is derived from cmd/sahinit/*.go and internal/hostinit/config.go. internal/fail/docs_test.go fails the build if a flag defined there is missing from this page.

Conventions:

  • Flags use Go's flag syntax: --name value, --name=value or -name value. A boolean flag is set by naming it (--boot); --boot=false also works.
  • Unless a section says otherwise, exit status is 0 for success, 1 for a refusal or failure after the arguments were accepted, and 2 for a usage error. A usage error prints the usage text on stderr.
  • Refusals are printed as one stable token (see codes), sometimes followed by a file or service name. Error text never carries paths, OS error strings or request contents, except for migrate and init (noted below).

Top-level dispatch (cmd/sahinit/main.go):

First argument Command
init PID 1 host init
supervise the supervisor
plan print boot waves
validate check a candidate catalog
ctl control a running supervisor
policy boot-policy metadata
sash sash floors
deploy stage verified deployment generations
logs, events read the journal
host host helpers: device wait, sd_notify adapter
migrate convert systemd, daemontools or OpenRC catalogs
apply internal sandbox helper; see below
anything else, or nothing usage text, exit 2

When the process is PID 1, every argument goes to init mode. A leading init is removed first, so the kernel can run /sahinit or /sahinit init with the init flags below. No other command can run as PID 1.

sahinit init

sahinit init [--dir DIR] [--socket PATH] [--recovery EXECUTABLE]
             [--shutdown-timeout DURATION] [--log-dir DIR]
             [--deployment-root DIR --trust FILE [--trust-system-clock]]
             [--sash PATH] [--sash-fleet-pub PATH] [--sash-floor-dir DIR]

Experimental Linux PID 1 parent. It refuses unless it is PID 1 and runs as root: as an ordinary process it prints init requires root Linux PID 1 (off Linux, init requires Linux PID 1) and exits 1. As PID 1 it never exits. See operations and host init.

Flag Type Default Constraints
--dir path /etc/sahinit/units Absolute. The unit directory passed to the supervisor.
--socket path /run/sahinit/control.sock Absolute. The control socket passed to the supervisor.
--recovery path empty (disabled) Absolute when set. A local console program PID 1 starts, as root, on the console, whenever the supervisor is not running.
--shutdown-timeout duration 30s From 1s to 10m. How long PID 1 waits for the supervisor to stop before it terminates every remaining process.
--log-dir path empty (no journal) Absolute when set. Passed on as supervise --log-dir.
--deployment-root path empty Absolute when set; needs --trust. The supervisor runs the active deployment generation instead of --dir.
--trust path empty Absolute; only with --deployment-root. The boot-policy trust file.
--trust-system-clock bool false Only with --deployment-root. Passed on; see supervise.
--sash path empty Absolute when set. Passed on as supervise --sash; when empty the supervisor's default /usr/bin/sash applies.
--sash-fleet-pub path empty Absolute when set. Passed on as supervise --sash-fleet-pub.
--sash-floor-dir path empty Absolute when set. Passed on as supervise --sash-floor-dir.

The supervisor is always started as sahinit supervise --dir DIR --socket PATH --boot-strict [--log-dir ...] [--sash ...] [--sash-fleet-pub ...] [--sash-floor-dir ...], or with --deployment-root DIR --trust FILE [--trust-system-clock] in place of --dir DIR.

Errors: an extra argument, a relative path, --trust or --trust-system-clock without --deployment-root (or the reverse), or a timeout outside the range is invalid init configuration; an unknown flag or a value that does not parse is Go's flag error text (for example flag provided but not defined: -x). As PID 1 either is logged as sahinit-init: recovery: setup: ERROR and PID 1 enters recovery (it does not exit). Signals to PID 1 are listed in operations.

sahinit supervise

sahinit supervise --dir DIR --socket PATH [--uid UID]... [--gid GID]
                  [--no-cgroups] [--cgroup-sweep DURATION] [--boot-strict]
                  [--log-dir DIR] [--sash PATH] [--sash-fleet-pub PATH]
                  [--sash-floor-dir DIR]
sahinit supervise --deployment-root DIR --trust FILE [--trust-system-clock]
                  --socket PATH [the other flags above]

Loads the unit catalog, opens the delegated cgroup root, prepares sash units, binds the control socket, boots the boot units in dependency waves and serves control requests until SIGINT or SIGTERM. SIGHUP is ignored. On exit it stops every service in reverse dependency order.

Flag Type Default Constraints
--dir path required unless --deployment-root The unit directory. See units. Exactly one of --dir and --deployment-root is given.
--deployment-root path none The deployment root: the units are the active generation's, each start is admitted by its signed policy, and ctl activate is enabled. Units the cgroup root cannot limit refuse the start (boot_refused), as in strict boot.
--trust path none Required with, and only with, --deployment-root: the boot-policy trust file (as policy --trust).
--trust-system-clock bool false Only with --deployment-root. Accept the system clock as the time anchor for expiring (renew) policies; without it their admission fails closed (policy_clock_uncertain). never policies do not read the clock.
--log-dir path none Absolute. The journal directory. If it cannot be opened (read-only, wrong owner or mode, held by another supervisor) the supervisor prints journal_unavailable TOKEN and runs without a journal; it never refuses the start for it.
--socket path required Absolute and clean. Its directory must be private (see files).
--uid uint32 none Repeatable. When given at least once, only the listed uids may use the socket; include the supervisor's own uid if it should still be allowed. Without it only the supervisor's effective uid is allowed.
--gid uint32 none At most once. Required (socket_group) when --uid names a uid other than the supervisor's: the socket is then mode 0660 with this group. Otherwise it is ignored.
--no-cgroups bool false Use process groups instead of cgroup v2. Units with limits are refused (cgroup_controller); sash units are refused (sash_cgroups). Status reports "cgroups":"disabled".
--cgroup-sweep duration 30s At least 0. Interval of the stray-cgroup sweep; 0 turns the timer off (the sweep still runs when a service ends, on every control request and at shutdown).
--boot-strict bool false Host-boot mode, used by init. Any refused unit file, refused limit or refused sash unit refuses the whole start (boot_refused). Every boot unit is essential unless its unit says "essential": false: when the boot waves end, an essential unit that is not ready (failed, never ready, crashed and waiting out a restart delay, blocked on a failed provider) stops the supervisor with exit 1 (boot_service_failed NAME); afterwards, one that becomes failed (a non-zero exit, a signal, restart_limit, watchdog), becomes stopped on its own (a simple unit that exits 0 without restart), or whose needs provider failed for good, does the same. After boot an automatic restart in progress is not a failure, but a crash loop ends in restart_limit (see restart). Units marked "essential": false fail alone.
--sash path /usr/bin/sash The sash binary, resolved and checked like a unit executable (sash_binary). Only used when a unit has sash.
--sash-fleet-pub path empty The fleet public key file. Required by sash units (sash_fleet_key).
--sash-floor-dir path empty The sash state directory: floors and the mount table. Required by sash units (sash_floor_store).

Startup order and what each step can print on stderr:

  1. Parse flags. Missing --dir or --socket, a bad --uid/--gid, a second --gid, a negative --cgroup-sweep or an extra argument: usage, exit 2.
  2. Load units. A catalog-level refusal (unit_perm, symlink, stray_file, too_many, empty, failed, and any parse token such as unknown_field) is printed and exits 2. Each refused unit file is printed as TOKEN FILE and left out. With --boot-strict only boot_refused is printed (exit 2); run plan to see which file.
  3. Open cgroups (cgroup_unavailable, cgroup_busy; exit 2), unless --no-cgroups or not Linux.
  4. Refuse units whose limits cannot be applied: cgroup_controller FILE.
  5. Prepare sash units: TOKEN FILE per refused sash unit (see operations).
  6. Plan the graph (cycle, missing_needs, missing_after, boot_needs, edge_empty; exit 2), clean sash mounts left by an earlier instance (sash_mount_leftover SERVICE DIR), bind the socket (socket_perm, socket_busy, socket_exists, socket_group; exit 2).
  7. With cgroups: cgroup_root_unprotected ROOT when no controller is enabled below the root; cgroup_leftover NAME.service for each cgroup an earlier instance left (a cgroup that will not empty is cgroup_stuck, exit 2).
  8. Open the journal when --log-dir is given (journal_unavailable TOKEN when it cannot be; the start goes on).
  9. Boot. A boot error is printed as its token; without --boot-strict the supervisor keeps running. Every 200 ms afterwards it reconciles dependencies: a running unit whose needs provider is no longer ready is stopped and marked blocked, and is started again when the provider is ready (in dependency order). A unit an operator stopped is not desired and stays stopped.

Exit status: 0 after a normal stop by signal; 1 when strict boot failed or the socket server failed; 2 when startup was refused.

sahinit plan

sahinit plan --dir DIR

Loads the catalog exactly as supervise does (without opening cgroups, reading sash keys or running sash --describe), plans the boot waves and prints one wave per line on stdout: the unit names of that wave, sorted, separated by spaces. Units with "boot": false are not printed.

Flag Type Default Constraints
--dir path required The unit directory.

stderr: TOKEN FILE for each refused unit file, then cgroup_trusted FILE for each unit that is cgroup-trusted. Exit 0 with a plan; exit 2 with a usage error or a catalog or graph refusal (the token is printed).

sahinit ctl

sahinit ctl --socket PATH status [NAME]
sahinit ctl --socket PATH diagnostics|explain|start|stop|restart|reload|check NAME
sahinit ctl --socket PATH --dir DIR diff|apply
sahinit ctl --socket PATH rollback|activate

Sends one framed JSON request ({"op":OP,"name":NAME}, with "arg":DIR for diff and apply) to a running supervisor and prints the JSON response on stdout.

Flag Type Default Constraints
--socket path required The supervisor's control socket.
--dir path none Required by diff and apply, refused by every other operation. An absolute unit directory, read by the supervisor (catalog_path when relative).
Operation Name Effect
status optional Status rows for every service, or one.
diagnostics required Output tails, recent events and the last exit of one service.
start required Start a stopped, failed or exited service. A oneshot answers arg_required (see below).
stop required Stop a service: SIGTERM, then SIGKILL after timeout. A stopped or exited service stays as it is; a failed one with no process becomes stopped.
restart required Stop, then start.
reload required Run a sash unit's reload entry.
check required Run a sash unit's check entry, read-only.
explain required {name, desired, state, reason, blocked_by}: why a unit is not running. blocked_by lists needs providers that are not ready; reason is the last error, or administratively_stopped for a unit an operator stopped.
diff none (--dir) Root only. Load and plan the catalog in DIR exactly as validate does and answer {added, removed, changed, affected} against the running catalog; changes nothing. affected adds every unit that transitively needs a changed one.
apply none (--dir) Root only. Replace the running catalog with DIR's: stop the affected units (dependents first), start the affected units that are desired (in dependency order). Unaffected units keep their processes, output and restart budgets. A failed replacement restores the old catalog (apply_rolled_back, or rollback_failed). Refused with a deployment (signed_activation_required), with sash units in either catalog (catalog_sash), while another change runs (busy), and before the boot waves end (boot_in_progress). Not written to disk: a restarted supervisor reads --dir again.
rollback none Root only. Apply the catalog that the last apply replaced (no_previous_catalog when none), with its desired states. Refused with a deployment (new_policy_required) and before the boot waves end (boot_in_progress).
activate none Root only. With --deployment-root: verify the pending generation, check it is fresh, admit every unit, apply it as apply does, then make it active on disk (see deployments). deployment_not_configured without a deployment; boot_in_progress until the boot waves end.

diff, apply, rollback and activate are refused with root_required unless the peer's effective uid is 0, even when --uid allows that peer status, start and stop.

Exit status: 0 when the response says "ok":true; 1 when it says "ok":false (the response is still printed), or when connecting (5 s timeout), writing or reading fails (prints failed); 2 for usage errors and unknown_op (an operation not in the table). The connection deadline is 11 minutes, enough for the longest stop plus the longest readiness wait.

The socket protocol also has oneshot with an arg field, which ctl does not expose; see the control protocol.

Errors in the response ("error"): uid_denied, peer_supervised, root_required, busy, not_found, arg_required, unknown_op, frame_size, failed, and any start, stop or sash token, for example needs_failed, needs_not_ready, timeout, cgroup_stuck, sash_grant_revoked, not_sash, no_entry, not_running, unhealthy. See codes.

sahinit validate

sahinit validate --dir DIR

Loads the catalog in DIR as supervise does (without cgroups or sash --describe) and plans it. Prints one JSON line {valid, error, refused, waves}: refused maps each refused file to its token (any refused file makes the catalog invalid, catalog_refused), waves are the boot waves. Exit 0 when valid, 1 when not, 2 for a usage error.

Flag Type Default Constraints
--dir path required The candidate unit directory.

sahinit deploy

sahinit deploy stage --root DIR --trust FILE --bundle DIR --manifest FILE
                     --document FILE [--trust-system-clock]
sahinit deploy status|bootstrap --root DIR --trust FILE [--trust-system-clock]

Stages and inspects verified deployment generations; see deployments for the bundle format.

Flag Type Default Constraints
--root path required Absolute and clean (deployment_path). Created 0700 when missing; must pass the trusted walk and have no group or other access (deployment_perm).
--trust path required The boot-policy trust file.
--trust-system-clock bool false Accept the system clock as the time anchor; without it an expiring policy is refused (policy_clock_uncertain).
--bundle path stage only (required) The candidate bundle directory.
--manifest path stage only (required) The manifest; its exact bytes must hash to the policy's catalog_sha256. At most 256 KiB (manifest_read).
--document path stage only (required) The signed policy envelope.
Operation Output Effect
stage {"pending":ID} Verify the policy and every file, copy the bundle into a new private generation, cache the policy and make it the pending generation. Staging the same generation again is idempotent.
status {"active","pending","previous"} Show the pointers.
bootstrap {"active":ID} First installation only: with no active generation, verify and admit the pending one and make it active (bootstrap_refused otherwise). Later changes use ctl activate.

Exit 1 with the token on stderr for a refusal; 2 for a usage error.

sahinit logs

sahinit logs [--dir DIR] [--unit NAME] [--boot ID] [--since SEQUENCE]
             [--contains TEXT] [--follow]

Prints journal records (one JSON object per line: {sequence, boot_id, time, unit, stream, data}, with data base64 encoded) of the stdout and stderr streams. See the journal.

Flag Type Default Constraints
--dir path /var/log/sahinit The journal directory (the supervisor's --log-dir).
--unit string all Only this unit (sahinit for the supervisor's own events).
--boot string all Only this boot ID (/proc/sys/kernel/random/boot_id of the writing boot).
--since uint64 0 Only records with a larger sequence.
--contains string none Only records whose data or event contains TEXT.
--follow bool false Keep polling (every 250 ms) until SIGINT or SIGTERM.

Exit 1 with journal_read when the journal cannot be read (missing, wrong owner or mode, a malformed complete record); 2 for a usage error. Reading needs the journal's owner (root under PID 1): the files are 0600.

sahinit events

sahinit events [--dir DIR] [--unit NAME] [--boot ID] [--since SEQUENCE]
               [--contains TEXT] [--follow]

As logs, for the event stream: the lifecycle events of ctl diagnostics ({"sequence","time","kind","pid","code","exit"} in event) and the supervisor's supervisor_started.

sahinit host

sahinit host device-wait --path DEVICE [--timeout DURATION]
sahinit host notify-adapter [--watchdog DURATION] -- PROGRAM [ARG]...

Linux-only helpers meant to be a unit's exec (off Linux they print host helpers require Linux and exit 1).

device-wait polls every 50 ms until DEVICE (absolute) exists as a device node, then exits 0; after --timeout (default 30s, at most 5m) it prints device_timeout and exits 1. Use it as a oneshot that other units need.

notify-adapter runs PROGRAM as its child with NOTIFY_SOCKET set to a private datagram socket and, with --watchdog (at most 5m), WATCHDOG_USEC. It accepts only READY=1 and WATCHDOG=1, and only from its direct child's credentials (SO_PASSCRED); it writes one byte to the unit's notify pipe (fd 3, SAHINIT_READY_FD=3, else notify_pipe_missing) for readiness and one per heartbeat after it. It forwards SIGTERM, SIGINT and SIGHUP to the child and exits with its status. There is no MAINPID, FDSTORE, EXTEND_TIMEOUT or barrier support: run the program in the foreground. Use it with "ready": "notify" and a matching unit watchdog.

Flag Type Default Constraints
--path path required (device-wait) Absolute device path.
--timeout duration 30s device-wait: more than 0, at most 5m.
--watchdog duration 0 (none) notify-adapter: from 0 to 5m; the interval exported as WATCHDOG_USEC.

sahinit policy

sahinit policy verify|cache|status|floor-install|floor-show --trust FILE
               [--document FILE] [--cache DIR] [--trust-system-clock]
sahinit policy refresh --trust FILE --cache DIR --endpoint HTTPS_URL
               --credential FILE [--trust-system-clock] [--once]

Verifies, caches and inspects signed boot-policy metadata. Metadata only: nothing here admits or blocks a unit; every report carries "enforcement":"metadata_only". Formats are in files and boot policy.

Flag Type Default Used by
--trust path required All. The local trust file: regular, not a symlink, owned by root or the effective uid, not group- or other-writable (policy_bad_trust), at most 64 KiB (policy_read_failed).
--document path none Required by verify, cache, floor-install; refused by status, floor-show, refresh. Regular file, not a symlink, at most 384 KiB.
--cache dir none Required by cache, status, floor-install, floor-show, refresh; refused by verify. Owned by the effective uid with no group or other access (policy_store_failed).
--trust-system-clock bool false All. Asserts that the system clock is already trustworthy. Without it, renew policies report clock_uncertain. never policies and floors do not read the clock.
--endpoint URL none refresh only (required). https:// with a host and no user info, query or fragment (policy_refresh_config).
--credential path none refresh only (required). Bearer credential file (policy_refresh_credential).
--once bool false refresh only. One attempt, then exit.

Any flag combination the "Used by" column does not allow is a usage error (exit 2).

Operation Output on stdout (one JSON line) Exit 1 when
verify {verified, enforcement, state, error, sequence, catalog_generation, policy_sha256, expires_at, offline_until, lifetime} the document is refused, or is not normally valid now (policy_expired, policy_not_yet_valid, policy_clock_uncertain, ...; the report is still printed with error).
cache the same report the document is refused or the store refuses it.
status the same report plus floor_min_sequence the cache or floor is refused; a cached policy below the floor prints {"state":"revoked","error":"policy_revoked",...} and exits 1.
floor-install {verified, enforcement, min_sequence, issued_at, floor_sha256} the floor is refused (policy_floor_rollback, policy_floor_conflict, ...).
floor-show the same floor report no floor (policy_floor_missing) or a refused floor.
refresh one JSON event per line see the renewal worker.

refresh exits 0 when stopped by SIGINT or SIGTERM and when the host does not renew (one not_renewing event). It exits 1 on a refusal (token on stderr) or when writing stdout fails. With --once it prints one attempt event (or not_renewing) and exits 0, or prints the token and exits 1.

sahinit sash

sahinit sash floor-install --dir DIR --fleet-pub PATH FILE
sahinit sash floor-show --dir DIR --fleet-pub PATH [SERVICE]

Installs and shows signed per-service sash floors (sahinit-sash-floor/1).

Flag Type Default Constraints
--dir dir required The sash state directory, the same as supervise --sash-floor-dir. A directory, not a symlink, owned by the effective uid with no group or other access (sash_floor_store_failed). Run the command as the uid the supervisor runs as (root under PID 1).
--fleet-pub path required The fleet public key: reached by the trusted walk, a regular file owned by root or the effective uid, not group- or other-writable, holding 32 raw bytes or 64 hex digits with an optional newline (sash_fleet_key).

floor-install FILE verifies FILE against the key and installs it. It prints {"service","min_serial","issued_at","digest"}. Refusals: sash_floor_bad_shape, sash_floor_bad_signature, sash_floor_rollback, sash_floor_conflict, sash_floor_busy, sash_floor_store_failed, and failed when FILE cannot be read. Installing the same floor again succeeds.

floor-show [SERVICE] prints one line per service (all services with a floor file when SERVICE is omitted). A service without a floor prints sash_floor_missing SERVICE on stderr; a floor that does not verify prints sash_floor_store_failed SERVICE. Exit 1 if any line failed.

A usage error, including an operation other than these two, prints the sash usage text and exits 2.

sahinit migrate

sahinit migrate --from FORMAT --source DIR [--out NEW_DIR] [--boot]

Converts a standalone, exported service catalog. It never runs source scripts or touches the running init system. See migration.

Flag Type Default Constraints
--from string required systemd, daemontools or openrc.
--source dir required A real directory (not a symlink) with 1 to 256 entries. Source files are regular files of at most 64 KiB without NUL bytes.
--out dir none (report only) A new directory: it is created with mode 0700 and must not exist. Unit files are written 0600. Nothing is written when the report has a blocker.
--boot bool false Mark every converted unit "boot": true, except daemontools services with a down file.

stdout: the JSON report {format, units, diagnostics, written}; each diagnostic is {source, line, severity, message}. Exit 0: converted (and written with --out). Exit 1: at least one diagnostic with severity error (a blocker); nothing written. Exit 2: usage, an unknown format, an unreadable source or a write failure. Unlike the other commands, migrate prints plain English errors (for example unknown source format "x"), which may include paths.

sahinit apply (internal)

apply is the sandbox helper: the supervisor re-executes its own binary as sahinit apply ... -- ARGV with a spec, a status pipe and the checked executable on inherited file descriptors. It joins the cgroup, applies the sandbox and execs the target. It has no flags of its own. Run by hand without those descriptors it exits 2 and does nothing. Do not call it.

Files and settings reference

Every file sahinit reads or writes, with its owner and mode rules and its format. sahinit has no configuration file: settings are the flags in cli, and everything below is a path passed by flag. Paths shown as defaults are real defaults only where marked; the rest are suggestions.

Two rules recur:

  • Trusted walk. A path is resolved one component at a time from /. Every directory it passes through must be owned by root or the supervisor's effective uid and not group- or other-writable; a sticky directory (such as /tmp) may be writable by others, but must still have such an owner. Symlinks are followed only inside such directories (at most 40). Implemented by unit.ResolveTrusted.
  • Owner and mode rule. The file itself is owned by root or the effective uid and is not group- or other-writable.

Summary

File Set by Read or written by Owner and mode Default path
Unit directory --dir supervise, plan, init owner and mode rule; not a symlink /etc/sahinit/units for init only
NAME.json unit supervise, plan owner and mode rule; regular, not a symlink, at most 64 KiB
Executables and #! interpreters unit exec at load and every launch trusted walk and owner and mode rule, executable
Control socket --socket supervise (creates), ctl socket 0600, or 0660 with --gid; directory owner-only writable /run/sahinit/control.sock for init only
SOCKET.lock supervise 0600, regular, one link, owned by the supervisor beside the socket
Cgroup root the supervisor's own cgroup supervise cgroup2 at /sys/fs/cgroup, writable by the supervisor /sys/fs/cgroup/sahinit under init
sash binary --sash supervise as an executable /usr/bin/sash
Fleet public key --sash-fleet-pub, --fleet-pub supervise, sahinit sash trusted walk; owner and mode rule; 32 raw bytes or 64 hex digits
sash state directory --sash-floor-dir, --dir supervise, sahinit sash owned by the effective uid, no group or other access (0700)
SERVICE.floor, lock, pending-* sash floor store 0600, owned by the effective uid, one link in the state directory
sash-mounts.json supervise written in the state directory in the state directory
Service script unit sash.file supervise trusted walk; owner and mode rule; no setuid/setgid/sticky
Grant unit sash.grant supervise trusted walk; owner and mode rule; mode exactly 0600
Trust file --trust sahinit policy owner root or effective uid, not group- or other-writable; regular; not a symlink; at most 64 KiB
Policy or floor document --document sahinit policy regular; not a symlink; at most 384 KiB
Policy cache directory --cache sahinit policy owned by the effective uid, no group or other access
policy.json, floor.json, lock, pending-* policy store 0600, owned by the effective uid, one link in the cache directory
Renewal credential --credential policy refresh owned by the effective uid, mode 0600 or stricter, one link, not a symlink
Journal directory --log-dir (supervise, init), --dir (logs, events) supervise writes, logs and events read trusted walk; no group or other access (0700); created 0700 when missing none for supervise and init (no journal); /var/log/sahinit for logs and events
current.jsonl, archive.N.jsonl, lock, view.lock the journal 0600, regular, one link, owned by root or the effective uid in the journal directory
Deployment root --deployment-root (supervise, init), --root (deploy) supervise, deploy absolute, clean; trusted walk; no group or other access; created 0700
state.json, lock, policy/, generations/ID/ deployments 0600 files, 0700 directories; artifacts 0555, unit files 0400 in the deployment root
Bundle, manifest --bundle, --manifest deploy stage each file: owner and mode rule, regular, not a symlink, trusted parent
Recovery program init --recovery PID 1 executed by path as root none (disabled)
/proc, /sys, /dev, /dev/pts, /dev/shm, /run, /sys/fs/cgroup PID 1 mounts them
/tmp PID 1 creates it (sticky, 1777) when missing
/proc/swaps PID 1 at shutdown (swapoff)
/run/sahinit PID 1 creates it, mode 0700
/proc/sys/kernel/random/boot_id read for the sash mount table
/proc/self/mountinfo PID 1 (mount checks, shutdown unmounts)

Unit directory and unit files

See units. The directory holds only regular NAME.json files; sahinit never writes there. sahinit migrate --out DIR creates a new directory (0700) with 0600 unit files, which meets the rule when run as the supervisor's uid.

Control socket and lock

  • --socket PATH must be absolute and clean. Its directory is resolved with the trusted walk and must be writable by its owner only: a sticky directory such as /tmp is refused (socket_perm), because anyone could pre-create the socket or its lock. Use a private directory such as /run/sahinit/.
  • PATH.lock is created 0600 and flocked exclusively for the supervisor's life (socket_busy for a second supervisor). It must be a regular file with one link owned by the supervisor (socket_exists otherwise). It is removed at exit.
  • The socket is bound in a fresh private directory, chmodded (and chowned to --gid) there, and hard-linked into place. Mode 0600 when only the supervisor's uid may connect; 0660 with group --gid when --uid names another uid (socket_group without --gid).
  • A leftover socket from a crash is removed only when it is a socket owned by the supervisor's uid and refuses a connection; anything else at the path is socket_exists. The socket is removed at exit.

Control protocol

One request per connection. A frame is a big-endian uint32 length and that many bytes of JSON, 1 to 64 KiB (frame_size). The server reads the request within 5 s and serves at most 32 connections at once (busy beyond that).

Request: {"op": OP, "name": NAME, "arg": ARG} with only those keys; op is required. Operations: status, diagnostics, explain, start, stop, restart, oneshot (with arg), reload, check; and, for a peer whose effective uid is 0 only (root_required), diff and apply (with arg, an absolute unit directory), rollback and activate.

Response: {"ok": bool, "error": TOKEN, "rows": [...], "diagnostics": {...}, "explanation": {...}, "diff": {...}}. rows is present for status and after a mutation on a known name; explanation for explain ({name, desired, state, reason, blocked_by}); diff for the catalog operations ({added, removed, changed, affected, generation, rolled_back}).

Status row:

Key Meaning
name, state, pid, ready, restarts state is stopped, starting, running, stopping, exited, failed or blocked
desired whether the unit should run: set by boot and start, cleared by stop
essential the unit's resolved essential (strict boot only acts on it)
sandbox the applied sandbox claim (none, no_new_privs,landlock_vN,caps) or empty
last_error the token of the last failure, or empty
cgroups enabled, disabled or unsupported
cgroup the service cgroup path, as /proc/PID/cgroup shows it
cgroup_trusted see security
limits {memory_max, cpu_max, pids_max}; zero or empty is no limit
usage {memory_current, pids_current, cpu_usage_usec}, only while the cgroup exists
sash sash units only: {entry, grant_serial, entries, procs}; procs rows are {name, pid, state, started_at, exit, signal}. Never the grant body or env values.

Diagnostics (diagnostics op, one service): name, cgroups, stdout and stderr (each {data: base64, dropped: N}, the last 8192 bytes), events (the last 64: {sequence, time, kind, pid, code, exit}), journal ({dropped, error} of the --log-dir journal, zero without one) and last_exit ({code, signal, time}; a signal exit has code -1). Event kinds: starting, started, ready, stopping, exited, ended, launch_failed, timeout, restart_limit, cgroup_stuck, and for sash units sash_start, sash_run, sash_stop, sash_reload, sash_check. Output is raw and may contain whatever the service printed, secrets included; it is kept in memory only and lost when the supervisor exits.

Cgroup root

supervise uses its own cgroup as the root. It must be on cgroup2 mounted at /sys/fs/cgroup, and the root directory, its cgroup.procs and cgroup.subtree_control must be writable by the supervisor (cgroup_unavailable). It flocks the root directory (cgroup_busy), moves itself into ROOT/supervisor, enables cpu, memory and pids below the root where offered, and creates ROOT/NAME.service (mode 0755) for each service start, and ROOT/NAME.scratch for each sash --describe. Under PID 1 the root is /sys/fs/cgroup/sahinit. See security for the sweep.

sash files

Fleet public key

32 raw bytes, or 64 hexadecimal digits with an optional trailing newline. Read at supervise start (restart the supervisor to change it). Whoever can replace it can sign grants and floors for every sash service on the host.

Service script and grant

The script is the sash service file (.sash). The grant is a JSON sash/2 document signed by the fleet key over sash-grant-v2\n followed by the canonical body, with "purpose":"service". sahinit reads at most 64 KiB and checks: the signature (grant_bad_sig), the shape (grant_bad_shape), no "*" entry (grant_star), no / root (grant_root_slash), exp 0 or in the future (grant_expired), service equal to the unit name (grant_service_mismatch), user and group equal to describe's (grant_identity_mismatch) and serial at or above the floor (sash_grant_revoked). The grant's host is not checked. Fields used by sahinit: service, user, group, serial, exp, exec, env_names, file_read, file_write, mounts, mount_sources, caps, allow_private. The fleet signer that produces grants is not part of sahinit.

sash state directory

--sash-floor-dir. A directory, not a symlink, owned by the supervisor's effective uid with no group or other access. Contents:

  • SERVICE.floor: the signed floor, {"payload": base64, "signature": base64}, at most 4 KiB. The payload is exactly {"version":"sahinit-sash-floor/1","service":S,"min_serial":N,"issued_at":T}, min_serial 1 to 2^53-1, issued_at above 0, signed by the fleet key over sahinit-sash-floor-v1\n + payload. No floor file means no floor.
  • lock: flock for installs and reads; an install in progress is waited for 2 s (sash_floor_busy).
  • pending-HEX: a temporary file during an install (create exclusive 0600, write, fsync, rename, directory fsync). A leftover one is ignored.
  • sash-mounts.json: {"boot": BOOT_ID, "mounts": [{"service","dir","kind","id"}]}, the mounts sash services made, with their unique mount IDs. At start, a table from the same boot is unmounted (sash_mount_leftover SERVICE DIR); a table that is not valid JSON logs sash_mount_state_corrupt; a table from another boot is discarded. The table is rewritten as mounts change.

Boot policy files

Formats are specified in boot policy; the rules on disk:

  • Trust file (--trust): strict JSON with tenant_id, host_id, enrollment_id, recovery_profile_id (each ^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$), keys (1 to 16 distinct key IDs mapped to standard-base64 32-byte Ed25519 public keys), max_validity_seconds (1 to 31622400), max_grace_seconds (0 to 31622400), max_job_seconds (1 to 86400), min_refresh_seconds (at least 30), max_refresh_seconds (at least the minimum, at most the validity) and optional max_lifetime (never, the default, or renew). Anything else is policy_bad_trust.
  • Cache directory (--cache): policy.json (the cached signed envelope, which is also the anti-rollback high-water mark), floor.json (the installed revocation floor), lock (policy_store_busy while held) and transient pending-* files. Create it yourself before first use, for example install -d -m 700 /var/lib/sahinit-policy.
  • Credential (--credential): 32 to 4096 printable ASCII characters without spaces and at most one trailing newline. Reread on every attempt, so it can be replaced in place. Never printed.

Journal

supervise --log-dir DIR keeps a bounded journal: current.jsonl (rotated at 1 MiB) and up to four archives archive.0.jsonl (newest) to archive.3.jsonl. Each line is one JSON record {sequence, boot_id, time, unit, stream, data, event}: stream is stdout, stderr or event; data is the output chunk (at most 8 KiB) base64 encoded by JSON, so binary output and terminal escapes stay inert; event is a lifecycle event object. sequence grows across restarts. Records queue in memory (256) and are written by a background goroutine that syncs every second and on close; a full queue drops records and counts them in the journal field of ctl diagnostics ({"dropped","error"}). An unsynced tail can be lost on power failure; opening repairs a torn final record. It is bounded operational logging, not an audit log. lock makes one writer per directory; view.lock lets readers and rotation exclude each other.

Deployment root

See deployments. generations/ID/ holds a verified copy of one bundle (manifest.json, policy.json, units/, artifacts/) and is never changed after it is renamed into place; ID is SEQUENCE- and the first 16 hex digits of the manifest digest. state.json is {"active","pending","previous"}. policy/ is a boot-policy store (policy.json, floor.json) holding the newest staged policy and the revocation floor: install a floor there with sahinit policy floor-install --trust FILE --document FLOOR --cache ROOT/policy. Nothing is pruned.

PID 1 files

PID 1 makes the mount propagation of / private, mounts /proc, /sys, /dev (devtmpfs, mode=0755), /dev/pts (devpts, nosuid,noexec,gid=5,mode=620,ptmxmode=666; group 5 is the conventional tty group), /dev/shm (tmpfs, nosuid,nodev,noexec,mode=1777), /run (tmpfs, mode=0755) and /sys/fs/cgroup (cgroup2) unless already mounted, creates /run/sahinit (0700), a sticky /tmp when missing, and /sys/fs/cgroup/sahinit/supervisor, requires /sys/fs/cgroup/sahinit/cgroup.kill, writes +cpu, +memory, +pids to /sys/fs/cgroup/cgroup.subtree_control where available, and opens /dev/console for standard input, output and error. At shutdown it reads /proc/self/mountinfo and unmounts every non-pseudo mount, deepest first, after swapoff of every swap area listed in /proc/swaps. It does no filesystem check and no switch_root; contrib/initramfs/init (see operations) does both before it execs sahinit on the new root.

Refusal and diagnostic codes

sahinit reports every failure as one stable token from a closed vocabulary (internal/fail): error text is the token and nothing else, so a path, a request id or an OS error string never reaches the control socket or a log. An error that is not a token becomes failed.

Tokens appear in four places:

  • on stderr of a command, alone or as TOKEN FILE / TOKEN NAME;
  • in a control-socket response's error;
  • in a status row's last_error, and in a diagnostics event's code;
  • in the supervisor's log lines (its stderr; the console under PID 1).

internal/fail/docs_test.go fails the build when a token defined in the source (every fail.E("...") literal, every log-line and status token) is missing from this page.

Each group below lists the code, what it means, and what to do.

General

Code Meaning What to do
failed A failure with no more specific token: malformed JSON, a missing required field, an I/O error, a credential that cannot be set, a connection that failed. Check the input against the reference; for ctl, check the socket path and that the supervisor runs. Under PID 1 look for the sahinit-init: log lines.
empty The unit directory has no units, every unit was left out, or the graph is empty. Add units, or fix the per-file refusals printed before it.
busy The service is already starting, running or stopping; another operation holds it; the socket has 32 requests in flight; a sash mount is in use. Retry after the current operation; for a mount, stop what uses it.
timeout A start did not become ready within the unit's timeout, a sash start's readiness ran out, or a sash wait verb ran out. (A plain stop never times out: it escalates to SIGKILL.) Raise timeout (at most 5m), or fix the readiness signal (notify writes to fd 3).
not_found No unit with that name, or (sash file verbs) a path that does not exist. Check the name with ctl status.
unsupported Not implemented here: a sash verb sahinit does not serve, an rbind on a kernel without open_tree, a kernel with no mount IDs. Use a supported verb or a newer kernel.

Service states and event kinds

These are not errors, but they are part of the same vocabulary.

Value Where Meaning
stopped state Not running; never started, stopped, or a simple unit that exited 0 without restart.
starting state, event A start is in progress (waiting for readiness).
running state Started and, for notify, ready.
stopping state, event A stop is in progress.
exited state, event A oneshot that exited 0; as an event, the main process exited (with exit).
failed state The last start or run failed; see last_error.
blocked state, event Desired, but a needs provider is not ready (last_error needs_not_ready) or failed (needs_failed). The supervisor starts it when the provider is ready again. ctl stop makes it stopped.
started event The process was launched.
ready event Readiness was reached.
ended event A sash service ended: no spawned process is left.

The other event kinds are launch_failed, timeout, restart_limit, cgroup_stuck, watchdog (a notify unit missed its watchdog and was killed), admission_denied (a deployment's policy refused a start; code holds the policy token) and, for sash units, sash_start, sash_run, sash_stop, sash_reload and sash_check (the entry's exit code in exit, the token in code).

Unit catalog (load)

Code Meaning What to do
unit_perm The unit directory or a unit file is owned by someone other than root or the supervisor's uid, or is group- or other-writable. A directory refuses the catalog; a file is left out (unit_perm FILE). chown root:root and chmod go-w the directory and files.
symlink The unit directory or a unit file is a symlink. (Also a sash file verb meeting a symlink.) Use real files.
stray_file A directory, dot-file, non-.json file or non-regular file in the unit directory. Move it out; the directory holds only NAME.json.
too_many More than 256 unit files. Split the catalog.
file_size A unit file is over 64 KiB. Shrink it.
unknown_field A key the schema does not have. Remove or correct it (units).
duplicate_field A JSON key appears twice, a dependency list repeats a name, or two units share a name. Remove the duplicate.
name_invalid name does not match ^[a-z][a-z0-9-]{0,62}$. Rename.
name_mismatch name differs from the file name. Make NAME.json hold "name": "NAME".
exec_relative exec[0] is not absolute and clean. Use an absolute, clean path.
type_invalid type is not simple or oneshot.
ready_invalid ready does not fit the type (exec/notify for simple, exit for oneshot).
restart_invalid restart is not no, on-failure or always, or a oneshot restarts.
timeout_range timeout is not a duration in (0, 5m].
edge_empty An empty name in needs, after or wants.
execution_invalid An execution rule failed: uid without gid, groups without identity, an ID of 4294967295, duplicate or over 64 groups, a bad directory, a bad or reserved (SAHINIT_) environment name, too much environment. Fix the field (units).
limit_invalid A memory_max, cpu_max or pids_max value is malformed or out of range. See limits.
sandbox_root A sandboxed unit has no uid or uid 0, or the helper found itself running as root with a sandbox. Give the unit a non-root execution.uid.
sandbox_privs no_new_privs is false. Remove it or set true.
sandbox_path A sandbox path is not absolute and clean, or at launch is missing or contains a symlink. Use the resolved real path.
sandbox_overlap A path is listed twice, or in both lists after resolution.
essential_requires_boot "essential": true on a unit with "boot": false. Remove it; only boot units are essential.
restart_delay_invalid restart_delay or restart_max_delay is not a duration string from 10ms to 5m, or the maximum is below the delay. See restart.
watchdog_invalid watchdog is not a duration string from 100ms to 5m, or the unit's ready is not notify.
sandbox_cap An unknown capability name, or the helper could not keep a listed capability (always the case today for a non-root unit). Leave caps empty.

Dependency graph

Code Meaning What to do
cycle needs, after and wants form a cycle (across the whole catalog). Break the cycle.
missing_needs A needs names a unit not in the catalog (or one left out at load). Add the unit, or fix the refusal that left it out.
missing_after An after names a unit not in the catalog.
boot_needs A boot unit needs a unit with "boot": false. Make the dependency a boot unit, or use after/wants.

Executables and launch

Code Meaning What to do
exec_not_file The executable (or a path component) is missing, not a regular executable file, or a symlink chain is too long; the helper's exec fd is not a regular executable. Install the program; check ls -l of the resolved path.
exec_perm The executable or a directory on its path is owned by someone other than root or the supervisor's uid, or writable by group or other (a sticky directory may be writable by others, but still needs that owner). Fix ownership and modes along the whole path.
exec_interp A #! script's interpreter is relative, is env (or busybox env), is itself a script, or the line is over 256 bytes. Name the real interpreter, e.g. #!/usr/bin/python3.
landlock_unavailable The kernel has no Landlock (or refused a ruleset). Enable Landlock (Linux 5.13+, lsm= including landlock), or drop the sandbox.
landlock_abi The sandbox needs a Landlock right the kernel's ABI lacks. Use a newer kernel.
openat2_unavailable No openat2 (Linux before 5.6). Use a newer kernel.
sandbox_timeout The sandbox helper did not report within the deadline. Check system load; see the unit's diagnostics.
sandbox_unsupported A sandbox was asked for off Linux. Run on Linux or drop the sandbox.
launch_failed Event kind: a launch failed; its code holds the reason. Read the event's code.
artifact_digest A deployment unit's executable does not hash to its signed sha256 at launch (it is hashed on every start), or a bundle or generation file does not match the manifest. The generation was changed on disk: stage a fresh one from a trusted bundle.
verified_exec_unavailable A deployment unit's executable could not be opened for reading (only an O_PATH descriptor), or the platform is not Linux, so it cannot be hashed; the launch is refused. Run deployments on Linux, as root.
watchdog last_error and event kind: a notify unit with watchdog closed its notify pipe or sent no byte within the interval, and its process group was killed. The restart policy then applies. Read its diagnostics; with notify-adapter, match --watchdog to the unit.

Lifecycle and control

Code Meaning What to do
needs_failed A needs dependency is failed; the unit is marked failed. Fix and start the dependency first.
needs_not_ready A needs dependency is not yet running and ready (or exited OK). Start it, or wait.
restart_limit More than 5 restarts within 30 s; the unit is failed. Find the crash in ctl diagnostics NAME, then ctl start NAME.
arg_required A oneshot was started without an argument through the socket (ctl start on a oneshot). Oneshots run at boot, or through the oneshot socket op with arg.
arg_rejected The oneshot argument is not [A-Za-z0-9._-]{1,64} or contains ...
not_oneshot The oneshot op on a unit that is not a oneshot.
unknown_op An operation the socket or ctl does not know.
uid_denied The peer's uid is not allowed (not the supervisor's uid, or not in --uid), or its credentials could not be read. Run ctl as an allowed uid.
peer_supervised The peer is a supervised process: inside the cgroup root (a service, the supervisor's leaf, an unknown cgroup), in a process group a service led, or gone before the check. A process in the root itself or .control is accepted only while the root is protected. Run ctl from outside the services, e.g. an admin shell or the outer manager.
frame_size A control frame is empty or over 64 KiB.
root_required diff, apply, rollback or activate from a peer whose effective uid is not 0. Run ctl as root.

Live catalog changes (ctl diff, apply, rollback, validate)

Code Meaning What to do
catalog_path The --dir sent with diff or apply is not absolute. Pass an absolute directory.
catalog_refused A unit file in the candidate catalog was refused (validate lists them in refused). Fix each refused file.
catalog_sash The running or the candidate catalog has a sash unit: live changes replace runtimes, and a sash unit's described script, grant and mounts are not carried across. Change such a catalog by restarting the supervisor.
apply_rolled_back A unit of the new catalog failed to stop or start, and the old catalog and desired states were restored. rolled_back is true in the diff. Read the failing unit's diagnostics; fix and apply again.
rollback_failed Restoring the old catalog after a failed apply or activation also failed. The running state is the mix the response's diff describes. Inspect ctl status; restart the supervisor if needed.
no_previous_catalog rollback with no earlier apply.
shutting_down A catalog change while the supervisor is stopping.
signed_activation_required apply while running a deployment: unsigned catalogs are refused. Stage a generation and ctl activate.
new_policy_required rollback while running a deployment. Restore earlier content with a newly signed, higher-sequence generation.

Journal

Code Meaning What to do
journal_unavailable Log journal_unavailable TOKEN: --log-dir could not be opened; the supervisor runs without a journal (output stays in the in-memory tails). TOKEN is one of the codes below or failed (for example a read-only file system). Fix the directory, then restart the supervisor.
journal_path --log-dir is not absolute.
journal_limits Internal size limits out of range.
journal_perm The directory or a journal file fails the trusted walk, has group or other access, is not a regular file with one link, or is owned by someone other than root or the supervisor's uid. install -d -m 700 -o root /var/log/sahinit.
journal_busy Another supervisor holds the journal's lock. One supervisor per journal.
journal_torn_record The current file ends in a record larger than the limit without a newline; it is not repaired automatically. Move the file aside.
journal_size A journal file is over 64 MiB. Move the file aside.
journal_read logs or events could not read the journal. Check the directory, the owner and that you run as it.

Deployments (deploy, ctl activate, supervise --deployment-root)

Code Meaning What to do
deployment_path --root is not absolute and clean.
deployment_perm The root, a pointer or a generation file fails the trusted walk, has the wrong owner, or the root has group or other access. chmod 700, owner root.
deployment_busy Another deploy or activation holds the deployment lock. Retry.
deployment_size A unit file over 64 KiB, an artifact over 64 MiB, or a bundle over 256 MiB.
deployment_state state.json names an invalid generation. Repair the pointer file from deploy status of a good copy.
deployment_durability The active pointer was renamed but its directory could not be synced: the candidate runs and is active, but may not survive a crash. Check the storage before the next change.
deployment_jobs The policy has jobs or offline_jobs, or the manifest has jobs or resources. Boot jobs are not supported. Remove them; run setup as oneshot units.
deployment_sash A deployment unit is a sash unit. Deployments carry exec units only. Deploy sash units through --dir.
deployment_no_pending ctl activate with no pending generation. deploy stage first.
deployment_not_configured ctl activate on a supervisor without --deployment-root.
boot_in_progress ctl apply, rollback or activate before the boot waves ended, after a strict boot failed, or while the supervisor stops. Wait for boot.
bootstrap_refused deploy bootstrap with an active generation already, or no pending one. Use ctl activate for later changes.
manifest_read The manifest file could not be read (missing, wrong owner or mode, over 256 KiB).
manifest_shape Wrong version, missing arrays, no units, over 256 units or artifacts, or nesting too deep. See the bundle format.
manifest_path A manifest path is absolute, unclean, escapes the bundle, repeats, or its digest is not 64 lowercase hex digits.
manifest_unit A unit path is not units/NAME.json with a valid name.
manifest_artifact An artifact path is not under artifacts/.
manifest_exec A unit's exec[0] is not @/artifacts/... naming a manifest artifact.
catalog_digest The manifest's bytes do not hash to the policy's catalog_sha256. Sign the manifest you ship, byte for byte.
catalog_units The policy's unit list and the manifest's units differ in number.
catalog_dependencies A policy unit is missing from the manifest, or its needs differ from the unit file's.
generation_conflict A generation with this ID exists with a different policy, or an ID does not match its content.
generation_invalid A pointer names a malformed generation ID.
pending_changed The pending pointer changed during activation. Retry ctl activate.
activation_commit The new generation ran but the active pointer could not be written; the old catalog was restored. Check the storage, then activate again.
policy_unit_denied The policy does not admit this start now: the unit is not in it, or the policy is in grace and the unit is not in offline_units, or it is expired and this is not an automatic restart of a runtime_restart_units unit. Renew the policy (stage and activate a newer one).

Host helpers (sahinit host)

Code Meaning What to do
device_timeout device-wait timed out before the device node appeared. Check the driver or raise --timeout.
notify_pipe_missing notify-adapter was not given the notify pipe as fd 3: the unit is not "ready": "notify". Set "ready": "notify".

Control socket (supervise start)

Code Meaning What to do
socket_perm The socket's directory fails the trusted walk, or is writable by group or other (including sticky /tmp). Use a private directory, e.g. install -d -m 700 /run/sahinit.
socket_busy Another supervisor holds SOCKET.lock. Stop it, or use another socket.
socket_exists Something other than our own stale socket is at the path, or the lock file is not ours. Remove it after checking nothing uses it.
socket_group --uid allows another uid but no --gid was given. Add --gid GID.

Cgroups

Code Meaning What to do
cgroup_unavailable No cgroup2 at /sys/fs/cgroup, or the supervisor's cgroup is not writable (not delegated). Run under Delegate=yes, in a private cgroup namespace, or as PID 1; or use --no-cgroups.
cgroup_busy Another supervisor holds the cgroup root's lock. One supervisor per root.
cgroup_controller A unit's limits need a controller the root does not offer, or limits without cgroups. Printed as cgroup_controller FILE. Enable the controller above the root, or remove the limit.
cgroup_join The child could not join its service cgroup. Check the root is not populated by other processes; see the diagnostics.
cgroup_stuck A service cgroup did not empty within the unit timeout after kill-all; the service is failed. Look for processes in uninterruptible sleep (D state); the next start retries.
cgroup_trusted Printed by plan as cgroup_trusted FILE, and a status field: the unit can leave its cgroup, so cgroup guarantees are not promised for it. Informational; sandbox it with a non-root uid to make it untrusted.
cgroup_leftover Log cgroup_leftover NAME.service: a service cgroup an earlier instance left was killed and removed. Informational.
cgroup_root_unprotected Log cgroup_root_unprotected ROOT: no controller is enabled below the root, so root and .control members are refused as peers. Move other processes out of the root so controllers can be enabled; run ctl from outside the root.
cgroup_stray Log cgroup_stray PID: a process in the supervisor's leaf other than sahinit was killed. Investigate a cgroup-trusted service.
cgroup_stray_cgroup Log cgroup_stray_cgroup PATH: an unknown cgroup under the root was killed and removed. Investigate a cgroup-trusted service.
cgroup_root_member Log cgroup_root_member PID: a process sits in the root itself or .control (left alone, logged once). Normally the outer manager; informational.

Strict boot (PID 1)

Code Meaning What to do
boot_refused With --boot-strict, a unit file, a limit or a sash unit was refused, so the whole boot is refused. Run sahinit plan --dir DIR (and supervise without --boot-strict in a test) to see each refusal.
boot_service_failed Log boot_service_failed NAME: in strict boot an essential unit (every boot unit not marked "essential": false) was not ready when the boot waves ended, or later became failed (a non-zero exit, a signal, a failed start, restart_limit, watchdog) or stopped on its own, or waits on a needs provider that did. The supervisor stops and PID 1 enters recovery. Read NAME's diagnostics in recovery; fix (or mark the unit "essential": false) and send SIGHUP to PID 1.

sash units: load

Code Meaning What to do
sash_unit_field A sash unit sets exec, type, ready, timeout, execution.groups, execution.directory or execution.environment. Remove it; the service script owns those.
sash_root A sash unit has no uid/gid or uid or gid 0. Run it as a dedicated service account.
sash_sandbox A sash unit has no sandbox. Add one.
sash_cgroup_trusted A sash unit is cgroup-trusted (a cgroupfs path in read_write_paths, or a cgroup-bypass cap). Remove it.
sash_file_perm The service script fails the trusted walk or the owner and mode rule, or has a setuid/setgid/sticky bit. chown root:root, chmod 644.
sash_grant_perm The grant file fails the same checks, or is not mode exactly 0600. chown root:root, chmod 600.
sash_binary Log sash_binary FILE: --sash does not resolve to a trusted executable. Install sash at a root-owned path.
sash_fleet_key No --sash-fleet-pub, or the key file fails its checks or format. See files.
sash_floor_store Log sash_floor_store FILE: no --sash-floor-dir, or it cannot be opened. Create it 0700, owned by the supervisor's uid.
sash_cgroups Sash units need cgroups (--no-cgroups or no cgroup root). Run with cgroups.
sash_describe sash --describe failed, exited non-zero, timed out (5 s), printed over 1 MiB or malformed output, or named no start/run entry. Run sash --describe FILE as the unit's user and fix the script.
sash_name_mismatch describe's name differs from the unit name.
sash_identity_mismatch describe's user/group are missing or do not resolve to the unit's uid/gid. Create the account, or fix the unit's ids.
sash_order_mismatch describe's dependency names are invalid, or differ from the unit's needs/after/wants. Remove the unit's lists or make them match.
sash_lifecycle_mismatch The unit's restart disagrees with describe's. Remove it from the unit.
sash_lifecycle_limit A ready or stop timeout or restart delay over 5 minutes, a restart burst over 5, or a restart window shorter than the restart delay. Lower it in the script.

sash units: grant and floor (before every start)

Every grant failure except sash_floor_busy fails the unit without restart and is logged as sash_grant SERVICE TOKEN.

Code Meaning What to do
sash_grant Log prefix: sash_grant SERVICE TOKEN. Read TOKEN below.
sash_unavailable The supervisor has no sash configuration (key or floor store) for a start. Start supervise with the sash flags.
grant_missing The grant file cannot be read.
grant_bad_shape The grant is not a well-formed sash/2 document with purpose service, or is over 64 KiB, or has a bad root path. Re-issue it.
grant_bad_sig The signature does not verify with the fleet key (also a sash/1 or v1-domain signature). Re-sign with the current fleet key.
grant_star A list holds "*". Re-issue with explicit entries.
grant_root_slash file_read/file_write names /.
grant_expired exp is set and in the past. Re-issue.
grant_service_mismatch The grant's service is not this unit's name.
grant_identity_mismatch The grant's user/group differ from describe's.
sash_grant_revoked The grant's serial is below the service's floor. Install a grant with a serial at or above the floor.
sash_floor_busy A floor install held the store lock for over 2 s (every grant check takes that lock, so a concurrent floor-install can cause it). Transient; the restart policy may retry. Retry.
sash_floor_missing sash floor-show: no floor for that service. Informational.
sash_floor_bad_shape A floor document or service name is malformed.
sash_floor_bad_signature A floor does not verify with the fleet key. Re-sign.
sash_floor_rollback A floor lower than the installed one. Floors only rise.
sash_floor_conflict A different floor with the same min_serial. Issue a higher min_serial.
sash_floor_store_failed The state directory or a floor file fails its owner/mode checks, cannot be read, does not verify with the current key, or a commit failed. Fails closed: starts are refused. Fix ownership (0700/0600, supervisor uid); after a key rotation see operations.

sash units: running

Code Meaning What to do
sash_config An entry exited 2: a configuration or grant error in sash. No restart. Logged as sash_entry_error SERVICE ENTRY TOKEN. Read TOKEN (sash's first stderr word).
sash_entry_error Log prefix: sash_entry_error SERVICE ENTRY TOKEN.
sash_not_ready The entry exited 3: not ready in time. Restart policy applies.
not_sash reload or check on an exec unit.
no_entry The script has no such entry.
not_running reload/check while the service is not running.
unhealthy The check entry did not exit 0.
check_read_only A check session asked for a mutating verb. Keep check read-only.
unknown_service svc.status named no such service.
unknown_name A verb named a process not in this service's table.
name_in_use svc.spawn reused a running process name.
too_many_names More than 64 process names.
ceiling A spawn cap is outside the unit's sandbox caps, or a limit is above sahinit's ceiling or unknown.
caps_unsupported A spawn asked for a capability; the sandbox cannot grant one yet. Drop the cap.
env_refused A spawn env name is not in the grant's env_names, malformed, or denylisted. See environment.
denied A verb outside the grant: an unlisted program, identity, cwd, path, probe target or owner; a target the service does not own. Extend the grant, or fix the script.
stream_denied A file: stream could not be opened beneath its root as the child. Check the path is under file_write and not a symlink.
exists A file verb's target exists as the wrong kind, or a mount point is already mounted by a service.
not_empty rm of a non-empty directory.
hardlink A file verb's target has more than one link.
mount_opt_refused A mount type or option outside the allowlist, or a remount option that would change the superblock.
mount_overlap A mount point at, under or above a file_write root.
not_mounted An umount or remount of a mount this service did not make (or that has changed).
sash_mount_leftover Log sash_mount_leftover SERVICE DIR: a mount from an earlier instance on this boot was removed at start. Informational.
sash_mount_forgotten Log sash_mount_forgotten SERVICE DIR: a recorded mount was no longer sahinit's and was dropped. Investigate who replaced it.
sash_mount_state_corrupt Log: sash-mounts.json is not valid JSON; it is reset. Check for leftover mounts by hand.
sash_umount Log sash_umount SERVICE TOKEN: unmounting a service's mount at its end failed. Unmount by hand.
sash_output Log sash_output SERVICE NAME STREAM: LINE: a spawned process's journal line.
sash_output_dropped Log sash_output_dropped SERVICE N: N journal lines over the rate limit (200 at once, 50/s) were not logged.

Boot policy (sahinit policy)

Code Meaning What to do
policy_read_failed The trust or document file cannot be opened (missing, a symlink), is not regular, or is too large.
policy_bad_trust The trust file's owner or mode is unsafe, or its contents are invalid. See files.
policy_bad_shape The envelope or payload is not exactly the schema. Re-issue.
policy_bad_signature The signature does not verify with the key the envelope names (or the key is not in the trust file). Check keys; see key rotation in operations.
policy_host_mismatch Tenant, host or enrollment ID differs from the trust file.
policy_recovery_mismatch The recovery profile ID differs from the trust file.
policy_ceiling A validity, grace, refresh or job time is above the trust file's ceiling.
policy_lifetime_cap A never policy where the trust file says max_lifetime: renew.
policy_rollback A lower sequence than the cache, or a lower catalog generation.
policy_sequence_conflict Different payload bytes at the cached sequence. Issue a higher sequence.
policy_generation_conflict A permission, catalog or lifetime change at the same catalog generation. Raise catalog_generation.
policy_revoked The policy's sequence is below the installed floor. Install a newer policy.
policy_floor_missing No floor is installed (floor-show). Informational.
policy_floor_rollback A floor lower than the installed one.
policy_floor_conflict A different floor with the same min_sequence.
policy_missing No cached policy. policy cache first.
policy_store_failed The cache directory or a file in it fails its checks, or a commit failed (the store then fails closed). Fix ownership (owner-only, effective uid); reopen and retry.
policy_store_busy Another process holds the cache lock. Retry.
policy_expired A renew policy is in grace or expired. Renew.
policy_not_yet_valid Before not_before.
policy_clock_uncertain A renew policy needs a trusted clock: no --trust-system-clock, not Linux, or trust was lost. Establish trusted time and pass the flag.
policy_clock_rollback Library only: a trusted time correction would move the anchored clock backwards. The CLI never applies corrections.
policy_not_renewing Internal: the host does not renew; refresh prints not_renewing and exits 0.
policy_refresh_config The endpoint is not a plain https:// URL with a host.
policy_refresh_credential The credential file fails its owner, mode, link or content rules. chmod 600, owned by the worker uid.
policy_refresh_transport Connection, TLS (1.3 only, system roots) or timeout failure.
policy_refresh_http A status other than 200 (401/403 excepted), or a redirect.
policy_refresh_denied 401 or 403. Check the credential.
policy_refresh_encoding A Content-Encoding other than identity.
policy_refresh_size The response body is over 384 KiB.
policy_refresh_stale The response is identical to the cache. The issuer must issue a new sequence.
not_renewing refresh event: this host does not renew; exit 0.
clock_uncertain Report state: no trusted clock for a renew policy. Other states: valid, grace, expired, not_yet_valid, missing, revoked.
metadata_only The enforcement value in every policy report: nothing is enforced.

Built from the sash-init repository's reference documentation (docs/reference) at commit 9dce56e on branch feat/host-ops. That branch is the reviewed chain, licensed GPL-3.0-or-later; it is not yet merged into main.