fn spawn_in_launcher_tree(
cmd: &mut Command,
) -> Result<(Child, u32), SrvSpawnError>Expand description
Spawn cmd (an srv process: the daemon, or migrate --prepare) so it
lives and dies with the launcher, before any of its code runs. Returns the
child and its pid.
- Windows: started suspended, assigned to the launcher’s Job Object J0,
then resumed (PR #570’s race pattern): srv opens files and sockets only
once it is in the job, so nothing it holds survives the launcher. With
no J0 (the degraded mode
main.rslogs) it is only resumed. A failure kills the suspended child, whichkill_on_drop(false)would otherwise leave as a zombie holding the data dir’s lockfile (#571). - Linux:
PR_SET_PDEATHSIG→ SIGKILL, so it is reaped even if the launcher dies abnormally (A0); async-signal-safe only, as for the host. - Unix: its own process group, for the teardown backstop’s
kill_process_group_forcefully(SPEC_LAUNCHER_TEARDOWN_BACKSTOP_2026_07_11).