-
Notifications
You must be signed in to change notification settings - Fork 182
Description
I want to suggest some general feature
Topgrade should allow for reboot without requiring a sudo password by using command "systemctl reboot" if the system is running systemd.
More information
If the linux system uses systemd you do not need to reboot using sudo, which requires typing in a password. Instead use the command "systemctl reboot" which will just reboot the system without further user action
https://www.freedesktop.org/software/systemd/man/latest/sd_booted.html
"Internally, this function checks whether the directory /run/systemd/system/ exists. A simple check like this can also be implemented trivially in shell or any other language."
Seems like you can check for this folder in rust and then execute the alternate command "systemctl reboot" instead in the below function
pub fn reboot() -> Result<()> { print!("Rebooting..."); Command::new("sudo").arg("reboot").status_checked() }
I do not know how to test this from a side branch, as I am using bazzite, an immutable desktop. I'm willing to give it a try though if there are instructions somewhere.