Skip to content

Commit 320fb5f

Browse files
committed
Create /run/reboot-required by default
When staging a new deployment, create /run/reboot-required to signal that a reboot is needed. This file is monitored by kured (Kubernetes Reboot Daemon) and other tools to detect when a system needs to be rebooted. This makes it easier to integrate bootc with kured and similar tools without requiring manual configuration or bridging.
1 parent c76d9e2 commit 320fb5f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/src/deploy.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,13 @@ pub(crate) async fn stage(
737737
})
738738
.await;
739739

740+
// Create /run/reboot-required to signal that a reboot is needed
741+
// This file is monitored by kured (Kubernetes Reboot Daemon)
742+
let run_dir = Dir::open_ambient_dir("/run", cap_std::ambient_authority())?;
743+
if !run_dir.try_exists("reboot-required")? {
744+
run_dir.atomic_write("reboot-required", b"").context("Creating /run/reboot-required")?;
745+
}
746+
740747
Ok(())
741748
}
742749

0 commit comments

Comments
 (0)