From 0854f9c5590474971e4e3a47ef224217321abfed Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Sun, 6 Oct 2024 21:39:47 +0800 Subject: [PATCH] revert: PR 866 (#927) --- src/steps/os/unix.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 38cda5ab..484d3ff5 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -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() }