fix: use systemctl for reboot/shutdown — loginctl lacks these verbs (v0.7.3)

This commit is contained in:
2026-03-29 18:59:00 +02:00
parent 2ca572773e
commit e59ed53d7a
3 changed files with 11 additions and 5 deletions
+4 -4
View File
@@ -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)]