Cover the lid switch in the update sleep inhibitor - #10205
Open
Roriz wants to merge 1 commit into
Open
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
omarchy-update-stay-awakeblocks sleep for the length of an update, but the inhibitor asks for--what=sleep:idle. Both of those are high-level inhibitor locks, andlogind.conf(5)says the lid switch ignores high-level locks by default:The two drop-ins in
etc/systemd/logind.conf.d/don't setLidSwitchIgnoreInhibited, so the default applies and closing the laptop duringomarchy updatesuspends the machine regardless of the block inhibitor. In the worst case that happens in the middle of a pacman transaction.Adding
handle-lid-switchto the mask fixes it at the call site, since low-level locks are honored whateverLidSwitchIgnoreInhibitedis set to. I preferred that over shipping a drop-in withLidSwitchIgnoreInhibited=no, which would change lid behavior for every application on the system instead of just this inhibitor.Nothing pinned the mask, so I added an assertion to
update-lock-test.sh. The sudo stub there already logs the wholesystemd-inhibitargv, which is the only place the mask is visible from a test. Reverting the one-word change makes the assertion fail../test/allgives 3156 passing. The four failures are unrelated and reproduce on a clean checkout ofquattro: three want anomarchy-pkgscheckout I don't have locally, and one isruntime-smoke-test.shcounting IPC handlers on a two-screen setup.#9467 rewrites this file and edits these exact
systemd-inhibitinvocations, but carries--what=sleep:idlethrough unchanged, so the same fix applies on that branch.Closes #10203