Skip to main content

run_detached

Function run_detached 

Source
pub async fn run_detached(
    command: &'static str,
    args: &[&str],
    timeout: Duration,
) -> Result<ExitStatus, CommandError>
Expand description

Runs a command with stdin, stdout and stderr connected to /dev/null and returns its exit status.

Use it for init scripts. A daemon that a script starts inherits the output pipes of run, which then never sees them close.

§Errors

Returns an error if the command can’t start or runs longer than timeout.