Repository navigation
Let the power-profiles-daemon migration finish without an active session - #16565
Merged
Merged
Conversation
Switching a power profile needs polkit's active-session grant, so the migration's closing autodetect was denied on an update over SSH or without a graphical login, failed under -euo pipefail after the package swap, and stopped the migration queue. The profile is applied by omarchy-powerprofiles-init at every login, so the migration reports the skipped switch and finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
[Medium impact] This PR appears safe to merge. SummaryMakes profile selection non-fatal in
Reviews (1) · Last reviewed commit: "Let the power-profiles-daemon migration ..." · Reviewed by Greptile |
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.
The migration #14737 added ends by applying the power profile with
omarchy-powerprofiles-set autodetect. Switching a profile needs polkit's active-session grant (org.freedesktop.UPower.PowerProfiles.switch-profile), which an update has only from inside a graphical login. Run over SSH, or on a machine nobody is logged into, polkit denies it, the setter exits non-zero, and underbash -euo pipefailthe migration fails after the package swap has already happened. That migration stays pending and stops every migration queued behind it.The profile does not need to be applied here:
default/hypr/autostart.luarunsomarchy-powerprofiles-initat every login, and that runs the sameautodetect. So the migration now reports that the switch is deferred and finishes, while a failed package swap or daemon restart still stops it as before. On a stock install over SSH it now exits 0 withomarchy-power-profiles-daemoninstalled and the daemon running, where it exited 1 with the AccessDenied above.The fix edits the shipped migration rather than adding one, because migrations run strictly in order: a new migration would wait behind this one forever, while machines where it failed still have it pending and rerun the corrected file.
Codex Medium and Muse Spark 1.3 (via pi, thinking high) reviewed it and found nothing to change. Muse separately traced the setter's other failure paths, all of which end at the same
powerprofilesctl set, and confirmed no later migration depends on the profile having been applied.🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex Medium and Muse Spark 1.3 High.