Repository navigation
Conversation
sleep and idle are high-level inhibitor locks, and logind ignores those for the lid switch unless LidSwitchIgnoreInhibited=no. Omarchy ships no such drop-in, so closing the lid during an update suspended the machine despite the block inhibitor that exists to prevent exactly that. handle-lid-switch is a low-level lock, which logind.conf(5) says is always honored irrespective of that setting. Closes omacom#10203 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
quattro rewrote the inhibitor launch into a single hold_command run through sudo -b, pkexec, or directly as root. Re-apply the handle-lid-switch lock to that command and keep the lid-switch assertion alongside the new cancellation tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AXE1uhq3MnwcgFFkGFspbX
|
Reviewed at The diagnosis holds. With Competing fix. #12419 makes the identical Second opinion. Codex Medium compared the two separately. This time it preferred this pull request, because it judged the orphan-prompt change unrelated to #10203. An earlier comparison by the same reviewer preferred #12419 for the reason above. It found no defect in the lid fix in either pull request. Its independence is not guaranteed. Nothing is needed from you. This waits on the maintainer's choice between the two. |
The previous assertion read the mask from the sudo stub's log inside the EUID != 0 block, so it never ran when the suite ran as root. Record the systemd-inhibit argv from the stub the full omarchy-update -y run already reaches, which runs either way and covers the launch real updates take. Taken from omacom#12419, which fixed the same bug with this test. Co-Authored-By: Anson Boby <ansonboby@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-checked at
The fix works on a real logind. I emulated a lid switch through uinput, with logind set to suspend on lid close and the suspend itself replaced by a no-op. Then I held the update inhibitor with
Tests. Second opinion. Codex Medium reviewed this head and found no defect. It found the change proportionate and checked that the root, sudo and pkexec launch paths all use the same Nothing is needed from you. This waits on the maintainer, and on the failing |
[Medium impact] The PR appears safe to merge; no actionable new issues were found. SummaryAdds
Reviews (5) · Last reviewed commit: "Drop the update cleanup test loop" · Reviewed by Greptile |
quattro shortened the keyring stub's sleep in update-lock-test.sh while this branch added the inhibitor argv log to the stubs beside it; keep both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This stopped merging cleanly after Re-checked at
One run of this branch did suspend, and it was the test, not the fix: it started while the previous run's suspend was still finishing, so Tests. Second opinion. Codex Medium reviewed the merged head and found no defect. It checked the conflict resolution and that the assertion still rejects #12419 makes the same lid fix. Its extra change to Nothing is needed from you. This waits on the maintainer, and on those |
|
Re-checked at The lid fix still works. I ran the same emulated lid switch as before: logind set to suspend on lid close, with the suspend itself a no-op, and the update inhibitor held while the lid closed.
The cleanup change. Tests. Second opinion. Codex Medium reviewed this head and found no defect in the fix. It judged the whole change proportionate and the cleanup commit in scope. It reached the same view of the revocation trade-off: a call for the maintainer, not a demonstrated security problem. It also preferred this PR over #12419, which makes the same lid fix and is newer. Its independence is not guaranteed. Nothing is needed from you. This waits on the maintainer, and on those |
|
@omarchybot, please review current head fae7f44 and restore/retain Merged current Validation on this merge:
Please identify any remaining condition for |
quattro's omacom#17000 dropped sudo revocation, so cleanup_update can no longer fail to revoke: take quattro's cleanup and drop the revoke case from the cleanup test, keeping the error and signal cases that check a failed update releases the lid lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It was added to check that cleanup released the inhibitor when sudo revocation failed. With quattro no longer revoking, the error and signal cases test behaviour quattro already has and pass without this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Re-checked at
What's left is your fix in The fix still works on a real logind. I emulated a lid switch through uinput, with logind set to suspend on lid close and the suspend itself a no-op. Then I held the update inhibitor and closed the lid:
Tests. Second opinion. Codex Medium and muse-wonder (via pi, thinking high) reviewed both rounds and found no defect. Both checked the conflict resolution against #17000 and found that it keeps everything this PR still needs. Codex raised that the cleanup loop no longer failed without this change, which is why it was removed. Both also preferred this PR over #12419. That one makes the same lid fix but is newer, and its orphan-prompt change adds nothing now: To answer your question: yes, One thing for you: the PR description still describes the sudo-revocation cleanup change and its test. Neither is in the diff now. Please update it so it describes only the lid lock. After that, this waits on the maintainer's choice between this and #12419, and on those |
Closing a laptop lid during an Omarchy update can suspend it in the middle of a package transaction. The existing
sleep:idleinhibitor does not cover the lid switch with logind's defaultLidSwitchIgnoreInhibited=yes.Add
handle-lid-switchto the update inhibitor's mask. This low-level lock covers lid-triggered suspend for the duration of the update without changing system-wide lid policy.Cleanup also stops the caller-owned inhibitor if sudo timestamp revocation fails, then exits unsuccessfully and retries revocation through the existing exit helper. Previously the immediate exit could leave the inhibitor blocking sleep after the update had failed.
The existing update-lock suite checks the actual inhibitor arguments, including when run as root, and checks cleanup on errors, HUP, INT, TERM and failed sudo revocation. The lid assertion was contributed by @ansonboby from #12419.
Updated to current
quattro(79dcccf) in fae7f44, without conflicts or changes to the fix.Validation:
Closes #10203. #12419 contains the same lid-mask fix; the reviewer previously selected this older PR to move forward.