Skip to content

Commit

Permalink
revert: PR 866 (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored Oct 6, 2024
1 parent e4a068d commit 0854f9c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/steps/os/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,18 +786,5 @@ pub fn run_maza(ctx: &ExecutionContext) -> Result<()> {
pub fn reboot() -> Result<()> {
print!("{}", t!("Rebooting..."));

cfg_if::cfg_if! {
if #[cfg(target_os = "linux")] {
// Per this doc: https://www.freedesktop.org/software/systemd/man/latest/sd_booted.html
//
// If this directory exists, then this Linux uses systemd as the init program.
let systemd_dir = Path::new("/run/systemd/system");
if let Ok(true) = systemd_dir.try_exists() {
// On Linux with systemd, `reboot` can be invoded without `sudo`.
return Command::new("reboot").status_checked();
}
}
}

Command::new("sudo").arg("reboot").status_checked()
}

0 comments on commit 0854f9c

Please sign in to comment.