Skip to content

Conversation

@gursewak1997
Copy link
Contributor

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.

Fixes: #1353

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a straightforward and effective change to create the /run/reboot-required file after a new deployment is staged. This aligns with standard practices for signaling a required reboot and facilitates integration with tools like kured.

The implementation in lib/src/deploy.rs is clear, concise, and uses appropriate error handling with anyhow and context. The use of cap_std for file operations is suitable, and atomic_write combined with a try_exists check provides a robust way to create the signal file idempotently.

After a thorough review, I found no issues of medium, high, or critical severity. The code is correct for its intended purpose, handles potential error conditions appropriately, and is maintainable.

@gursewak1997 gursewak1997 marked this pull request as ready for review June 17, 2025 20:39
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! One nit, and can you also add an integration test in say test-image-pushpull-upgrade.nu around like 68?

Comment on lines 743 to 745
if !run_dir.try_exists("reboot-required")? {
run_dir.atomic_write("reboot-required", b"").context("Creating /run/reboot-required")?;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd say we should drop the conditional and always do the write - there's no harm to doing it, and updating the timestamp on the file also acts a signal that something changed again.

Comment on lines 69 to 70
let rr_meta = ls /run/reboot-required
assert equal $rr_meta.name "/run/reboot-required"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is failing because ls returns a table. It should work if you do ls /run/reboot-required | first instead.

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.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters
Copy link
Collaborator

Yeah confusingly nushell has a dedicated "size" type that's not an integer, I fixed the test

@cgwalters cgwalters merged commit 2b1897c into bootc-dev:main Jun 18, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create /run/reboot-required by default

2 participants