Skip to content

Skip the reboot prompt when the flag predates the current boot - #8724

Open
Pillumz wants to merge 1 commit into
basecamp:quattrofrom
Pillumz:fix/stale-reboot-required-flag
Open

Skip the reboot prompt when the flag predates the current boot#8724
Pillumz wants to merge 1 commit into
basecamp:quattrofrom
Pillumz:fix/stale-reboot-required-flag

Conversation

@Pillumz

@Pillumz Pillumz commented Aug 28, 2026

Copy link
Copy Markdown

Problem

After omarchy update, omarchy-update-restart keeps asking "Updates require reboot. Ready?" on a machine that has already rebooted.

~/.local/state/omarchy/reboot-required is set by migrations and by the sudoless Docker commands (#8080), and the only thing that ever clears it is omarchy-system-reboot. Reboot any other way - systemctl reboot, the power button, a hard reset after a freeze - and the flag survives, so every following update prompts for a reboot that already happened. Saying No leaves it in place; the only way out is to accept the prompt once or delete the file by hand.

Seen here on 4.0.1: a migration set the flag on Aug 25, the machine was rebooted on Aug 27 outside the Omarchy path, and today's update (three userspace packages and an AUR rebuild, running kernel matching the installed one) still asked for a reboot.

Fix

In the reboot-required branch, compare the flag's mtime with the kernel's boot time from /proc/stat (btime). A flag written before the current boot has already been honoured, so clear it and move on. A flag written since boot, for example by a migration in the same update run, still prompts as before. The kernel and Hyprland checks are untouched.

Tests

New test/shell.d/update-restart-test.sh mocks uname, pacman, pgrep, gum and the reboot/restart commands, points HOME at a temp dir and covers three cases: a flag older than boot is cleared without a prompt, a flag newer than boot prompts and survives a declined prompt, and no flag means no prompt. It skips when there is no kernel under /usr/lib/modules, since the kernel check makes that branch unreachable there. system-power-test.sh and update-sequence-test.sh still pass.

Only omarchy-system-reboot clears reboot-required, so a reboot by any other route (systemctl reboot, the power button, a crash) leaves the flag behind and every later update prompts for a reboot that already happened. Compare the flag's mtime with the kernel's boot time and clear it when the reboot has been done.
Copilot AI balanced review requested due to automatic review settings August 28, 2026 06:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents stale reboot prompts by clearing reboot markers created before the current boot.

Changes:

  • Compares reboot-marker mtime with /proc/stat boot time.
  • Adds regression tests for stale, current, and absent markers.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
bin/omarchy-update-restart Clears reboot markers already honored by a reboot.
test/shell.d/update-restart-test.sh Tests reboot-marker timestamp handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants