From 66ca17f8998da15a29a2331554473a0da54053cb Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 30 Nov 2025 10:05:18 +0100 Subject: [PATCH] init: Add a nowait command that immediately daemonizes This is useful for daemons on which no other daemon has a dependency as those would no longer need to use redox_daemon to daemonize themself. --- init/src/main.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init/src/main.rs b/init/src/main.rs index 42bf6fbd29..a20e489f32 100644 --- a/init/src/main.rs +++ b/init/src/main.rs @@ -179,6 +179,22 @@ pub fn run(file: &Path) -> Result<()> { env::remove_var(&arg); } } + "nowait" => { + if let Some(cmd) = args.next() { + let mut command = Command::new(cmd); + + for arg in args { + command.arg(arg); + } + + match command.spawn() { + Ok(_child) => {} + Err(err) => println!("init: failed to execute '{}': {}", line, err), + } + } else { + println!("init: failed to run nowait: no argument"); + } + } _ => { let mut command = Command::new(cmd.clone()); for arg in args {