Function respawn_if_requested
pub fn respawn_if_requested() -> Option<u32>Expand description
If a respawn was requested, launch a detached child running the captured launch command (now the new on-disk binary), and return its PID.
Call this after the daemon has torn down, so the listening port is free.
The child is detached (new session on unix; DETACHED_PROCESS on windows)
and inherits this process’s stdio, so it logs wherever the daemon did. A bare
process has no supervisor,
so if the child fails to start the service stays down until restarted by
hand (the previous binary remains as a .bak).