pub fn init_foreground_daemon() -> Result<()>
Write the current process’s PID and setup signal handler for cleanup. Called from the foreground-daemon process after fork.