Skip to content

Skip reboot prompts in unattended updates - #8992

Open
maxcroy1 wants to merge 1 commit into
omacom:quattrofrom
maxcroy1:fix/unattended-restart-prompt
Open

Skip reboot prompts in unattended updates#8992
maxcroy1 wants to merge 1 commit into
omacom:quattrofrom
maxcroy1:fix/unattended-restart-prompt

Conversation

@maxcroy1

Copy link
Copy Markdown

Summary

  • skip gum confirm when an update is unattended or has no usable input/output terminal
  • keep reporting why a reboot is needed and preserve the interactive reboot offer
  • exercise the real restart helper with fail-closed stubs for interactive, unattended pseudo-TTY, and headless calls

Evidence

Before the fix, the isolated regression test passed its interactive control and then proved that -y still reached the prompt inside the pseudo-TTY created by script(1):

ok - interactive restart check offers the reboot on the update pseudo-terminal
gum stdin=yes stdout=yes unattended=1 args=confirm Linux kernel has been updated. Reboot?
shell restart
not ok - -y reaches the post-update reboot prompt

The failure reproduced four out of four times. The harness used a fake HOME, forced a harmless kernel mismatch, and stubbed uname, pacman, gum, pgrep, omarchy-system-reboot, omarchy-state, and restart commands. No real prompt, package operation, state change, restart, or reboot was attempted.

After the fix:

ok - interactive restart check offers the reboot on the update pseudo-terminal
ok - -y reports the required reboot without asking
ok - headless restart check reports the required reboot without asking

Testing

  • bash test/shell.d/update-restart-test.sh in a Bubblewrap sandbox: passes
  • ./test/cli in the same sandbox: passes
  • ./test/all in the sandbox: the new test and existing update sequence coverage pass; the aggregate remains nonzero on five unrelated environment checks that require the separate omarchy-pkgs checkout, a live network route, or absence of an installed URL-check helper

The sandbox used a read-only checkout, private user/PID/network/IPC namespaces, temporary home/runtime filesystems, minimal devices, cleared desktop/session variables, and no access to the live Wayland, Hyprland, D-Bus, or user-service session.

Fixes #8986

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.

omarchy update -y can block at the post-update reboot prompt

1 participant