omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

WiFi powersave udev rule fails: script in user home inaccessible to udev worker

Open peterberkenbosch opened this issue 9 months ago • 5 comments

Summary

The 99-wifi-powersave.rules udev rule introduced in 3.4.0 (migration 1770811646) references $HOME/.local/share/omarchy/bin/omarchy-wifi-powersave, but udev workers run as root with PrivateMounts sandboxing and cannot access user home directories. The script never executes, WiFi power-save stays enabled on AC power, and on affected MediaTek chips this leads to firmware crashes.

System Specs

  • Device: Framework 13
  • WiFi: MediaTek MT7922 (mt7921e driver)
  • Kernel: 6.18.9-arch1-2
  • Omarchy: 3.4.0

Symptoms

  1. omarchy-wifi-powersave never runs — udev can't find it
  2. WiFi power-save stays on even when plugged into AC power
  3. MT7922 firmware eventually crashes with Failed to get patch semaphore / chip reset failed
  4. WiFi interface goes DOWN and cannot recover without module reload or reboot

Root Cause

The migration 1770811646.sh sources install/config/wifi-powersave-rules.sh, which writes:

SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/home/<user>/.local/share/omarchy/bin/omarchy-wifi-powersave off"

Since systemd 256+, udev workers use PrivateMounts sandboxing. The path inside the user's home directory is inaccessible to the root-run udev worker, producing:

(udev-worker)[1460]: ACAD: Failed to find and pin callout binary "/home/peter/.local/share/omarchy/bin/omarchy-wifi-powersave": No such file or directory

Suggested Fix

Copy or symlink the script to a system-accessible path, and update the udev rule to reference it:

# In the migration / install script:
sudo cp "$HOME/.local/share/omarchy/bin/omarchy-wifi-powersave" /usr/local/bin/omarchy-wifi-powersave
sudo chmod 755 /usr/local/bin/omarchy-wifi-powersave

Then in the udev rule:

SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/local/bin/omarchy-wifi-powersave on"
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/local/bin/omarchy-wifi-powersave off"

Reproduction

  1. Update to Omarchy 3.4.0 on a laptop with a MediaTek WiFi chip
  2. Observe journalctl -b | grep wifi-powersave — shows the "Failed to find and pin callout binary" error
  3. WiFi power-save remains active on AC; over time the firmware may crash

peterberkenbosch avatar Feb 28 '26 11:02 peterberkenbosch

Additional finding: iw is not installed by default on Omarchy, but omarchy-wifi-powersave depends on it:

iw dev "$iface" set power_save "$1" 2>/dev/null

Even with the udev path fixed, the script would silently fail because iw isn't present. The 2>/dev/null masks the error.

The migration or install script should ensure iw is installed as a dependency, e.g.:

sudo pacman -S --noconfirm --needed iw

peterberkenbosch avatar Feb 28 '26 11:02 peterberkenbosch

iw is installed by default as a dependency of wireless-regdb.

The $HOME variable is expended in the install script, not the rule itself. You can verify with :

cat /etc/udev/rules.d/99-wifi-powersave.rules

pomartel avatar Mar 02 '26 02:03 pomartel

I'm experiencing the same issue on my system although I am not using a MediaTek Chip and aren't experiencing network driver crashes.

System:

  • Device: Lenovo ThinkBook 15 G2 ITL
  • WiFi: Intel Wi-Fi 6 AX201 (iwlwifi driver)
  • Omarchy: 3.4.0
  • Kernel: 6.18.13-arch1-1

Error from journalctl:

Mar 03 07:02:30 omarchy (udev-worker)[676]: ACAD: Failed to find and pin callout binary "/home/sean/.local/share/omarchy/bin/omarchy-wifi-powersave": No such file or directory

This results in iw wlan0 get power_save showing Power save: on even on AC.

sean-imus avatar Mar 03 '26 12:03 sean-imus

This is happening to me too. Related PR #5141. Added my comment to the PR with more details.

jelenv avatar Apr 07 '26 13:04 jelenv

Fixed in latest release.

dhh avatar Apr 22 '26 12:04 dhh