fix: use systemctl instead of loginctl for reboot/poweroff
loginctl has no reboot/poweroff subcommands — these are systemctl commands. The error was silently swallowed because stderr wasn't captured and logs went to a non-existent directory.
This commit is contained in:
+2
-2
@@ -37,8 +37,8 @@ fn run_command(action: &'static str, program: &str, args: &[&str]) -> Result<(),
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn reboot() -> Result<(), PowerError> { run_command("reboot", "/usr/bin/loginctl", &["reboot"]) }
|
||||
pub fn shutdown() -> Result<(), PowerError> { run_command("shutdown", "/usr/bin/loginctl", &["poweroff"]) }
|
||||
pub fn reboot() -> Result<(), PowerError> { run_command("reboot", "/usr/bin/systemctl", &["reboot"]) }
|
||||
pub fn shutdown() -> Result<(), PowerError> { run_command("shutdown", "/usr/bin/systemctl", &["poweroff"]) }
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
Reference in New Issue
Block a user