Expand description
PID 1 init mode for pipette.
When pipette runs as PID 1 (e.g., via rdinit=/pipette in the kernel
cmdline), it performs minimal init duties (mount filesystems), then
forks. The child runs the normal pipette agent. PID 1 stays in a
simple wait() loop, reaping all children (including orphans adopted
by PID 1). When the pipette child exits, PID 1 calls reboot(2).
This fork-based design avoids conflicts between PID 1’s reaping
duties and the pipette execute handler’s Child::wait() calls —
PID 1 never runs pipette logic, so there’s no race between
waitpid(-1) and waitpid(specific_pid).
Statics§
Functions§
- init_
as_ pid1 - Perform minimal init duties and fork.
- is_pid1
- Returns
trueif this process is running as PID 1. - mount 🔒
- mount_
or_ 🔒warn - pid1_
reap_ 🔒loop - PID 1 reap loop: wait for children forever.
- was_
forked_ from_ pid1 - Returns
trueif this process was forked from PID 1 and should usereboot(2)directly for shutdown.