From 9f566a2e1fd830291117eaca86ecb74426444b58 Mon Sep 17 00:00:00 2001 From: Joseph Marrero Corchado Date: Mon, 30 Jun 2025 13:46:21 -0400 Subject: [PATCH] lib/src/reboot: use systemd-run to execute the reboot When we do a reboot it is triggered inside the bootc namespace. As we implement support for soft-reboots we need to make sure that systemd has a view into the mounted /run/nextroot to be able to act on doing a soft-reboot or a reboot. By using systemd-run we avoid the limited view in the current namespace. Signed-off-by: Joseph Marrero Corchado --- lib/src/reboot.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/reboot.rs b/lib/src/reboot.rs index c6917818..91581bc2 100644 --- a/lib/src/reboot.rs +++ b/lib/src/reboot.rs @@ -13,7 +13,9 @@ pub(crate) fn reboot() -> anyhow::Result<()> { // Flush output streams let _ = std::io::stdout().flush(); let _ = std::io::stderr().flush(); - Task::new("Rebooting system", "reboot").run()?; + Task::new("Rebooting system", "systemd-run") + .args(["--message=Initiated by bootc", "reboot"]) + .run()?; tracing::debug!("Initiated reboot, sleeping forever..."); loop { std::thread::park();