Repository navigation
Conversation
Automated AI review
Verified: the change addresses the lid-close suspend described in #10203. In systemd v261 logind, a lid close is refused early while a block-mode One behavior change worth a decision, and one test gap, follow. Lid lock now also covers the orphan-package prompt
Impact: a laptop closed and packed away while the update waits at this question stays powered, with idle suppressed, until someone answers or cancels. Before this PR, the same lid close suspended the machine at a point where suspending was harmless. This follows from source; it was not tested on hardware. Suggested change: release the stay-awake lock (or at least its lid part) before the orphan step, so protection covers the package transactions but not the final question. Alternatively, keep the current scope and document the trade-off. Optional test improvement: the new assertion calls
Note: #10205 makes the same two-line Review informationTest scope: Source review of the changed script, its callers and upstream systemd v261 logind (v262 unchanged for this behavior). AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Both points are right — pushed in
About #10205: fine by me whichever the maintainers prefer — happy to close this in favor of whichever PR lands first. |
Automated AI review
Follow-up to the earlier review and the author's reply, checked at Outcome: both earlier points are resolved at this head. The PR now conflicts with current
Verified:
One correction to the reply: Rebasing onto current
|
logind ignores high-level sleep locks for the lid switch (LidSwitchIgnoreInhibited defaults to yes), so closing the lid suspended mid-update despite the stay-awake inhibitor. Take the low-level handle-lid-switch lock as well, by adding it to the sleep:idle mask on the single systemd-inhibit launcher; scoped to updates only, so normal lid behavior resumes on stop. Fixes omacom#10203.
1bb0973 to
60a6eff
Compare
-y exports OMARCHY_UPDATE_UNATTENDED=1, and docs/update-process.md already says interactive review steps report and skip instead of blocking, but the orphan step only skipped when there was no terminal. In a terminal -y still stopped on a gum confirm, so an unanswered question held the update's sleep inhibitor for as long as the prompt sat there. Match omarchy-update-restart's reboot prompt and the conflicted-package handoff, which both report and skip under the same variable. Interactive updates still ask; only -y is suppressed. Tested on a pty: without one the existing non-interactive guard answers for this case and hides the regression.
|
Rebased onto current The mask is now the single edit you described: The dropped commit. You are right that neither direct port works, and I dropped the commit that released the inhibitor before the orphan step rather than reshaping it. The reasoning that decided it: The orphan prompt now follows your Tests, per your note about the absolute path: the mask assertion now runs through Mutation-checked rather than assumed: reverting the mask to On the interactive prompt: it still reaches the question, so the lid lock covers the moment someone is reading it. I left that as-is rather than bounding it, because a confirmation that expires mid-answer trades one surprise for another and you offered it as an either/or; if you'd rather have the bounded prompt, say so and I'll add it. On the docs: the "stop after status" you saw was the pre-rebase head. On the rebased branch |
|
Reviewed at The fix works on a real logind. On the VM I emulated a lid switch through uinput (an
Tests. Orphan prompt. Competing fix. #10205 makes the same one-line Second opinion. Codex Medium reviewed the diff and separately compared it with #10205. It found no defect introduced here and also preferred this PR. That agrees with my own read, and its independence is not guaranteed. It also pointed out a problem that predates this PR: if sudo revocation fails in Nothing is needed from you. This now waits on the maintainer, with the failing |
|
Re-checked because this now conflicts with The lid fix still works. On a disposable Omarchy VM I merged Competing fix. With the orphan half gone, this PR and #10205 make the identical one-line change to the same Second opinion. Codex Medium compared the two PRs separately and also chose #10205 under the same rule. It found no defect in either lid change and agreed the orphan change now works against #14428. Its line references check out against Nothing is needed from you. This waits on the maintainer, who decides between this PR and #10205. |
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>
|
The lid-switch half is still needed: live Currently CONFLICTING after #14428 (auto-approve orphans). The |
Summary
Closing the lid suspended the machine mid-update despite the stay-awake inhibitor.
omarchy-update-stay-awaketook only high-levelsleep:idlelocks, which logind ignores for the lid switch (LidSwitchIgnoreInhibiteddefaults toyes).Adds the low-level
handle-lid-switchlock to the mask on the singlesystemd-inhibitlauncher (--what=sleep:idle:handle-lid-switch). Scoped to updates only — normal lid behavior resumes on stop. Deliberately not a globalLidSwitchIgnoreInhibited=nodrop-in, which would let every stray high-level sleep lock (video players, browsers) block lid-close system-wide.Rebased onto the reworked update flow. The earlier commit that released the inhibitor just before the orphan prompt has been dropped: quattro's reordering deliberately keeps the inhibitor through the user-facing work (
13a4306a, asserted byupdate-hook-security-test.sh), so releasing it there would undo that guarantee and movestop, which is not this PR's call.Instead the orphan step now honours
OMARCHY_UPDATE_UNATTENDED, which is the shapedocs/update-process.mdalready documents ("-y… suppresses Omarchy confirmation prompts. Interactive review steps (orphan removal, conflict handoff) report and skip instead of blocking") and whichomarchy-update-restartand the conflicted-package handoff already implement. The prompt stayed in place for an interactive update — only-yis suppressed — so no ordering moves and the confirmedpacman -Rnsremoval still runs inside the inhibited window.One consequence left deliberately: an interactive run still reaches the prompt, so the lid lock covers the moment somebody is reading it. That falls out of keeping the inhibitor through user work, and a prompt that silently expires mid-answer seemed a worse trade than a machine that stays awake while its owner decides. Say the word if you'd rather have it bounded and I'll add the timeout.
Test plan
update-lock-testasserts the mask the launcher actually builds, observed through the real update flow (sandboxedomarchy-updatewith its privileged paths redirected to stand-ins) rather than the shape of the code around it. Reverting the mask tosleep:idlefails that assertion.update-orphan-testruns both prompt cases on a pty, because without one the existing non-interactive guard answers for the unattended case and hides the regression: unattended reports and skips without reachinggum; interactive still reachesgum. Deleting the unattended branch fails the first.update-lock-test,update-sequence-test,update-stay-awake-security-test,update-hook-security-test,update-orphan-test,update-user-path-test,bin-style-test,manifest-entrypoints-testall pass.Fixes #10203.