Skip to main content

spawn_daemon

Function spawn_daemon 

Source
pub fn spawn_daemon(command: &mut Command) -> Result<DaemonChild>
Expand description

Spawn command as a detached daemon. NUL stdio, sanitized handles, no console window, ignores parent’s Ctrl-C / SIGINT (Windows: CREATE_NEW_PROCESS_GROUP + DETACHED_PROCESS; Unix: setsid puts the daemon in a new session so it’s not in the parent’s foreground group).

Use spawn_daemon_with_stdio when the daemon must write to stable caller-owned files. Parent stdio and anonymous pipes remain unavailable for detached children.