Expand description
The supervision engine — abstract Supervisor trait + two impls.
LinuxSupervisor does the real PID-1 work via fork(2)/execve(2);
MockSupervisor records actions for unit tests. The orchestration loop
in run_once is written against the trait, so testing the scheduler
logic requires no privileges.
Structs§
- Linux
Supervisor - Real PID-1 backend. Uses libc
fork/execve/waitpid/kill. Safe to compile on macOS (same libc surface); running meaningfully requires being PID 1 in a Linux kernel. - Mock
Supervisor - In-memory supervisor for tests. Records spawns + signals;
reap_onereturns queued exits in FIFO order. - Reaped
Event
Enums§
Traits§
- Supervisor
- Minimum interface a supervisor backend must expose.
Functions§
- boot
- Walk the config and spawn every enabled service. Returns the per-name PIDs. Deterministic; errors on the first spawn failure with no partial state (caller can retry with a new env).
- run_
once - Drain any pending child exits. Applies the restart policy for each service keyed by the PID we spawned for it.