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:
@@ -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())),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user