Expand description
Process lifecycle management for the agent daemon.
Initializing ProcessManager transfers process-wide child-status ownership
to its dedicated thread: it drains waitpid(-1, WNOHANG) and therefore also
consumes statuses for untracked children. Code that needs an exit status must
acquire ProcessManager::spawn_guard before creating the process and finish
with ProcessSpawnGuard::track. It must not independently wait on the same
child PID during normal operation. Terminal teardown is the deliberate
exception: it may reap any remaining child directly when the manager itself
can no longer be assumed healthy.
Structsยง
- Process
Exit Watcher - Observes the eventual exit code of a tracked process.
- Process
Identity - Stable identity for one registration of an operating-system PID.
- Process
Manager - Coordinates process spawning, exit observation, and process-wide child reaping.
- Process
Spawn Guard - Keeps process reaping paused until a newly spawned PID is tracked.