Skip to content

Stop the update inhibitor without a TERM error - #13324

Closed
dhh wants to merge 1 commit into
quattrofrom
fix/stay-awake-quiet-stop
Closed

dhh wants to merge 1 commit into
quattrofrom
fix/stay-awake-quiet-stop

Conversation

@dhh

@dhh dhh commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Every omarchy update ends with:

'/usr/bin/setpriv' terminated by signal TERM.

omarchy-update-stay-awake stop ends the sleep inhibitor by sending TERM to the held process. That process had exec'd sleep infinity, so it died from the signal. systemd-inhibit waits on its child and reports any child killed by a signal as an error, then exits 1. The message is harmless, because sudo -b detaches the inhibitor and nothing checks its status, but it looks like a failure at the end of every update. It predates #13323; it has shown up since the identity-bound cleanup in 6af052f.

Fix

The held shell now stays alive, sleeps in 60-second background chunks, and exits 0 from a TERM trap that also kills the current sleep. systemd-inhibit then sees a clean exit and stays quiet.

Identity checks are unchanged. The shell already carries --why=Omarchy update in progress [token] as its $0, and it's the same process whose PID and start time it records, so stop still matches on PID, start time, owner and token. If stop ever escalates to KILL, the leftover sleep lasts at most 60 seconds.

Verification

  • Reproduced with the real systemd-inhibit (idle lock). The old pattern printed '/usr/bin/sleep' terminated by signal TERM. and exited 1. The new one exits 0 with no output and leaves no sleep behind.
  • New test in update-stay-awake-security: the fake systemd-inhibit records its child's exit status, and a stopped inhibitor must exit 0. It fails against the old code.
  • The cancellation-window test now anchors on the new trap stop_holding TERM line instead of exec -a.
  • Full ./test/shell fails only the same four files as clean quattro (kernel-headers migration, kernel migration, passwordless-grant lifecycle, unowned system paths).

🤖 Generated with Claude Code

Every omarchy update ended with "'/usr/bin/setpriv' terminated by signal
TERM." Stay-awake stops its inhibitor by sending TERM to the held
process, which had exec'd sleep infinity and so died from the signal.
systemd-inhibit reports any child killed by a signal as an error and
exits 1.

Keep the held shell alive instead, sleeping in the background, and exit
0 from a TERM trap. The shell already carries the update token as its
$0, so stop still identifies it by pid, start time, owner, and token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shawnyeager

Copy link
Copy Markdown
Contributor

Reported as #13337.

@dhh

dhh commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #13361, which fixes the same message with a smaller change: the held shell traps TERM, kills its sleep, and exits 0.

@dhh dhh closed this Sep 26, 2026
@dhh
dhh deleted the fix/stay-awake-quiet-stop branch September 26, 2026 21:11
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