fix: use systemctl for reboot/shutdown — loginctl lacks these verbs (v0.7.3)
This commit is contained in:
+4
-4
@@ -127,14 +127,14 @@ pub fn hibernate() -> Result<(), PowerError> {
|
||||
run_command("hibernate", "/usr/bin/systemctl", &["hibernate"])
|
||||
}
|
||||
|
||||
/// Reboot the system via loginctl.
|
||||
/// Reboot the system via systemctl.
|
||||
pub fn reboot() -> Result<(), PowerError> {
|
||||
run_command("reboot", "/usr/bin/loginctl", &["reboot"])
|
||||
run_command("reboot", "/usr/bin/systemctl", &["reboot"])
|
||||
}
|
||||
|
||||
/// Shut down the system via loginctl.
|
||||
/// Shut down the system via systemctl.
|
||||
pub fn shutdown() -> Result<(), PowerError> {
|
||||
run_command("shutdown", "/usr/bin/loginctl", &["poweroff"])
|
||||
run_command("shutdown", "/usr/bin/systemctl", &["poweroff"])
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user