init: Allow init to register the scheme for a daemon

Unfortunately the scheme still has to be created by the daemon due to a
kernel bug, but once that is fixed, it would allow delayed spawning of
scheme daemons.
This commit is contained in:
bjorn3
2026-02-18 22:29:56 +01:00
parent 7dad7af1f0
commit 7ebeceb41d
16 changed files with 190 additions and 74 deletions
+11
View File
@@ -37,6 +37,7 @@ pub enum Command {
// Service
Nowait(String, Vec<String>),
Notify(String, Vec<String>),
Scheme(String, String, Vec<String>),
Regular(String, Vec<String>),
// Modify env
@@ -110,6 +111,16 @@ impl Command {
Ok(Command::Notify(cmd, args.collect()))
}
"scheme" => {
let Some(scheme) = args.next() else {
return Err("init: failed to run scheme: no argument".to_owned());
};
let Some(cmd) = args.next() else {
return Err("init: failed to run scheme: missing command".to_owned());
};
Ok(Command::Scheme(scheme, cmd, args.collect()))
}
_ => Ok(Command::Regular(cmd, args.collect())),
}
}