pub fn init_foreground_daemon() -> Result<()>
Write the current process’s PID. Called from the foreground-daemon process.