omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy-powerprofiles-set fails at boot (exit 1): CPU power profile never applied on AC

Open kshatriya-abhay opened this issue 3 months ago • 2 comments

Summary

omarchy-powerprofiles-set fails with exit code 1 on every AC-detection udev event during boot, so the CPU power profile is never applied on AC. The system stays on whatever profile power-profiles-daemon defaulted to (e.g. power-saver from a battery session), so the CPU is throttled even while plugged in.

Environment

  • Omarchy 4.0.0-1 (package; /usr/share/omarchy/version reports 4.0.0.alpha)
  • power-profiles-daemon 0.30-1
  • Kernel 7.1.8-arch1-3
  • CPU: 11th Gen Intel Core i7-11800H (Acer Nitro)
  • Last package update: Aug 21 2026

Symptoms

  • journalctl shows the udev-driven profile setter failing with exit code 1 at every AC event during boot.
  • powerprofilesctl get does not show the intended AC profile (performance) after boot.

Evidence

Journal (today, 3 boots):

Aug 25 11:01:56 acer-nitro (udev-worker)[770]: ACAD: Process '/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service /home/abhay/.local/share/omarchy/bin/omarchy-powerprofiles-set' failed with exit code 1.
Aug 25 11:01:57 acer-nitro (udev-worker)[758]: ucsi-source-psy-USBC000:001: Process '/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service /home/abhay/.local/share/omarchy/bin/omarchy-powerprofiles-set' failed with exit code 1.
Aug 25 11:02:01 acer-nitro systemd[1]: Starting Power Profiles daemon...
Aug 25 12:27:52 acer-nitro (udev-worker)[774]: ACAD: Process '...omarchy-powerprofiles-set' failed with exit code 1.
Aug 25 13:11:44 acer-nitro (udev-worker)[760]: ACAD: Process '...omarchy-powerprofiles-set' failed with exit code 1.

Note the ordering: the udev event fires (11:01:56) before power-profiles-daemon starts (11:02:01), so powerprofilesctl set fails because the daemon isn't up.

Root cause

/etc/udev/rules.d/99-power-profile.rules:

SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service /home/abhay/.local/share/omarchy/bin/omarchy-powerprofiles-set"
  • systemd-run --no-block does not wait for the transient unit; the After=power-profiles-daemon.service ordering only applies when both units are part of the same transaction, which is not guaranteed here because udev fires the RUN program directly and the daemon may not be started yet at boot.
  • Result: the script races the daemon and loses; powerprofilesctl set exits 1; the AC profile (default performance) is never applied.
  • User state confirms the asymmetry: ~/.local/state/omarchy/powerprofiles/ contains only battery: power-saver (no ac file), so on AC the intended profile comes from the default fallback in the script — which is never reached when the daemon is down.

Expected behavior

The AC/battery power profile should be applied reliably on every power-source event, including during boot, even if power-profiles-daemon starts after the udev event.

Suggested fix directions

  • Drop --no-block (or add --wait) so the ordering actually synchronizes, or
  • Have the script itself wait/retry for the daemon (e.g. loop on powerprofilesctl or busctl up to N seconds), or
  • Trigger the setter from a systemd service with proper After=power-profiles-daemon.service / Requires= ordering instead of a udev RUN program.

Steps to reproduce

  1. On battery, let the profile settle to power-saver (state file written).
  2. Reboot while unplugged, then plug in AC (or reboot with AC attached).
  3. Observe journalctl --since boot | grep omarchy-powerprofiles-set → exit code 1.
  4. powerprofilesctl get will not show the AC profile (performance).

Impact

The CPU profile is not switched to performance on AC as intended, so the CPU stays throttled (e.g. in power-saver) while plugged in. This is a functional bug in profile application; the performance impact on this machine was CPU-level only.

Note (out of scope for this bug)

Initial investigation surfaced a concurrent symptom — slow HDD writes (~12 MB/s) on this machine — which was initially assumed to be related. It was subsequently determined to be independent: power-profiles-daemon on this system manages only the CPU (no disk/APM handling), and the drive's aggressive head parking is a firmware characteristic (WD IntelliPark, 63k load cycles over 11k power-on hours). That is a drive-firmware matter, not an Omarchy bug.

kshatriya-abhay avatar Aug 25 '26 08:08 kshatriya-abhay

Note: this bug appears to be already resolved on the quattro branch (the current default), so this issue can be closed if it is not backported to the shipping release.

Investigation on quattro shows the systemd-run --no-block udev rule no longer exists — the only udev rule in the tree is default/udev/framework16-qmk-hid.rules. Power profile wiring was redesigned to avoid the boot race entirely:

  1. At session start, default/hypr/autostart.lua runs omarchy-powerprofiles-init (→ omarchy-powerprofiles-set autodetect) from within the Hyprland session, by which point power-profiles-daemon is guaranteed to be running.
  2. AC/battery switches are handled by the shell's shell/plugins/services/battery/Service.qml, which watches UPower and calls omarchy-powerprofiles-set ac|battery in user context.

The omarchy-powerprofiles-set script itself is identical on quattro — only the trigger mechanism changed.

kshatriya-abhay avatar Aug 25 '26 12:08 kshatriya-abhay

This is already fixed in Omarchy 4.0.2 and later. Your follow-up was right that quattro no longer has the udev rule. Here is what changed, and why your 4.0.0.alpha install still had the rule.

The failing rule is the Omarchy 3 one, /etc/udev/rules.d/99-power-profile.rules, which runs systemd-run --no-block --collect --unit=omarchy-power-profile .... With --no-block, systemd-run returns as soon as it has queued the transient unit, so the exit code 1 that udev logs comes from systemd-run itself, not from omarchy-powerprofiles-set or powerprofilesctl. The setter never started. So the evidence does not support the daemon race described in the report. One proven cause is the fixed unit name colliding when ACAD and the USB-C supplies fire together (749a8c046, fixed in 3.8.3). The journal lines do not show the reason for every failure.

Omarchy 4 removes the mechanism. Since 4.0.0 (0f2f3f11c), no install writes a power-profile udev rule. The profile is set at login by omarchy-powerprofiles-init from Hyprland's autostart, and after that the shell's battery service switches it whenever UPower reports a plug or unplug. On machines upgraded from 3.x, the old file stayed behind through 4.0.1. Migration migrations/1788102906.sh (#9002, first released in 4.0.2) deletes it, or moves it aside if it was edited. After updating to 4.0.2 or later, ls /etc/udev/rules.d/ should no longer list 99-power-profile.rules.

I checked this against quattro and the v4.0.0 through v4.0.4 trees. On a worker built from the Omarchy ISO, quattro's migration test passed (36 checks), including the exact rule shown in this report, and so did powerprofiles-set-test.sh (10 checks). Codex Medium reviewed the diagnosis separately and agreed. It is not guaranteed to be independent of my reasoning. It also noted that the login-time set is not retried if it fails. Nothing here shows that happening, though, because powerprofilesctl activates the daemon over D-Bus when it is not yet running.

#5688 reports the same boot failure on 3.7.1. I tried to close this one as its duplicate, but the duplicate check's second opinion did not agree, since the logs on #5688 are screenshots. Both stay open, and the maintainer will decide whether to close them. If this still happens on 4.0.2 or later, reply with the output of ls /etc/udev/rules.d/ and journalctl -b | grep -i -E "udev-worker|powerprofiles" from a boot with AC plugged in.

omarchybot avatar Oct 09 '26 01:10 omarchybot