diff options
| author | 2026-05-13 13:43:33 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:33 +0100 | |
| commit | 5b6bfa3904a2013dbcd798488baf4661332880d0 (patch) | |
| tree | 30b3e4a57b437c5c30f7b58a9d2a8332726755bb /etc/systemd | |
| parent | 04894b00ff99f3aff184dbaffdd4d5b1edb7dcf9 (diff) | |
| download | dotfiles-5b6bfa3904a2013dbcd798488baf4661332880d0.tar.gz dotfiles-5b6bfa3904a2013dbcd798488baf4661332880d0.tar.bz2 dotfiles-5b6bfa3904a2013dbcd798488baf4661332880d0.zip | |
fix(logind): ignore KEY_POWER long-press too
The Shokz dongle emits KEY_POWER press without a matching release on
USB disconnect; logind classified that as a long-press after 5s and
fired HandlePowerKeyLongPress=poweroff (confirmed in journal: 'Power
key pressed long. Powering off...').
There is no policy that distinguishes 'real 5s hold of power button'
from 'misbehaving device that never sends release'. Ignore both.
Clean shutdowns now require systemctl poweroff or GUI menus; a very
long hold of the physical power button still force-offs via firmware.
Diffstat (limited to 'etc/systemd')
| -rw-r--r-- | etc/systemd/logind.conf.d/10-ignore-power-key.conf | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/etc/systemd/logind.conf.d/10-ignore-power-key.conf b/etc/systemd/logind.conf.d/10-ignore-power-key.conf index 6f01dc0..1ca4cc3 100644 --- a/etc/systemd/logind.conf.d/10-ignore-power-key.conf +++ b/etc/systemd/logind.conf.d/10-ignore-power-key.conf @@ -1,8 +1,14 @@ [Login] -# Ignore single-tap KEY_POWER from any source. Misbehaving USB devices -# (cheap keyboards, KVM switches, headset dongles) sometimes emit -# KEY_POWER on enumeration or for unrelated buttons, which would -# otherwise shut the host down. A long-press (>=5s) still triggers -# poweroff, preserving the real hardware-power-button safety net. +# Ignore KEY_POWER from any source. Misbehaving USB devices (cheap +# keyboards, KVM switches, headset dongles) sometimes emit KEY_POWER on +# enumeration, hot-plug, or for unrelated buttons -- and some emit a +# press without a matching release, which logind classifies as a +# long-press and acts on after 5s. Ignoring both short and long press +# is the only reliable policy without per-device evdev filtering. +# +# Real shutdowns: `systemctl poweroff` or GUI menus. The laptop's +# physical power button also emits KEY_POWER and is now a no-op for +# clean shutdowns; a very long hold (~10s) still triggers a firmware +# force-off as a last resort. HandlePowerKey=ignore -HandlePowerKeyLongPress=poweroff +HandlePowerKeyLongPress=ignore |
