Repository navigation
Probe sudo non-interactively so unattended updates cannot hang - #9875
konsorsiumai wants to merge 1 commit into
Conversation
|
hey — this looks like a duplicate of #12900 (same stay-awake |
|
Thanks for the clear write-up and reproducer. The hang you describe was real, and What was checked. On a worker built from the Omarchy ISO, set up the way #9066 describes (a passworded
Why The Second opinion. Codex Medium reviewed the pull request against Next. This is waiting on the maintainer, with a recommendation to close it as already fixed on |
Problem
omarchy updaterun non-interactively (scripts, cron, AI agents — a workflow the manual explicitly supports) hangs for exactly 5 minutes and then aborts with "Something went wrong during the update!". By that point the pre-update snapshot has already been created, so the user is left with a confusing failure and no update.Root cause
Three pieces conspire:
omarchy-updatere-executes itself underscript -qefc ... /tmp/omarchy-update.logfor logging, so every step runs with a PTY on stdin.omarchy-update-stay-awake start()picks its privilege runner with[[ -t 0 ]]— which is therefore always true under the logging PTY — and runssudo -v.sudo -vcannot complete without typed input: on current Arch sudo it prompts even whenNOPASSWD: ALLis granted, waitspasswd_timeout(default 300 s), then fails.set -eplus the ERR trap abort the whole update.Journal evidence from a real machine: three failed update attempts at 00:27–00:28, and one that hung from 01:01:58 to exactly 01:07:01 (≈
passwd_timeout) before aborting right after the snapshot step.Reproducer on an affected system (returns nothing until killed, 300 s unattended):
timeout 12 script -qefc 'omarchy-update-stay-awake start' /dev/nullFix
Replace the tty guess with a capability probe:
[[ -t 0 ]]check.Tests
test/shell.d/update-lock-test.shupdated: the sudo stub handles the-n trueprobe, and the terminal-section assertion now verifies the non-interactive probe instead ofsudo -v. All 7 assertions pass.Related (not in this PR)
omarchy-sudo-keepalive(sourced byomarchy-pkg-install/omarchy-pkg-aur-install) opens with a baresudo -vand can hang menu-driven package installs the same way while passwordless sudo is enabled. Happy to file or fix that separately.