Power button doesn't shutdown anymore

I’ve been using Patchbox OS for a while now (without a Pisound HAT) on a Raspberry Pi 5 and experimenting with Tracktion Waveform there. This works well as long as I use X11 as the display server.

Until recently, I was always able to shut down the Raspberry Pi by pressing the power button twice. When connected via VNC, you could actually see the shutdown dialog appear, and the second press would trigger the “shutdown” option. This was very convenient, especially since I plan to use the Pi headless in the future.

For some reason, the shutdown dialog no longer responds to the power button. Booting still works fine, and holding the button down for a long time still causes a “hard” power-off.

What could be the reason for this?

The power button on Pi 5 most likely generates a KEY_POWER event for some process on the system to handle.

Take a look at this link and the mentioned locations on the file system, check if there’s anything to fix in the configuration:

Alternatively, if you have a spare SD card, flash an OS image into it and check if the power button works like you expect on a ‘clean’ install. If it does, you’ll have to look what changed on your main OS that would prevent it from working as expected.

Thank you for yor reply, i’ll take a look at it and hope, i can find a solution there.
The power button itself seems to work fine since i get a feedback via sudo journalctl -f:

patch@patchbox:~ $ sudo journalctl -f
Feb 06 11:05:15 patchbox systemd[1]: Starting packagekit.service - PackageKit Daemon...
Feb 06 11:05:15 patchbox PackageKit[4627]: daemon start
Feb 06 11:05:15 patchbox dbus-daemon[727]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Feb 06 11:05:15 patchbox systemd[1]: Started packagekit.service - PackageKit Daemon.
Feb 06 11:05:17 patchbox sudo[3396]: pam_unix(sudo:session): session closed for user root
Feb 06 11:05:17 patchbox sudo[4636]:    patch : TTY=pts/0 ; PWD=/home/patch ; USER=root ; COMMAND=/usr/bin/apt install x11-xserver-utils
Feb 06 11:05:17 patchbox sudo[4636]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Feb 06 11:05:18 patchbox sudo[4636]: pam_unix(sudo:session): session closed for user root
Feb 06 11:08:09 patchbox sudo[4649]:    patch : TTY=pts/0 ; PWD=/home/patch ; USER=root ; COMMAND=/usr/bin/journalctl -f
Feb 06 11:08:09 patchbox sudo[4649]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Feb 06 11:08:12 patchbox systemd-logind[741]: Power key pressed short.
Feb 06 11:08:15 patchbox systemd-logind[741]: Power key pressed short.

I tried using evtest --grab but the command was not found.
i checked /etc/login.conf but i don’t know, how it normally should look like. It seems, that all options are commented out, is that correct? how does your file look like?

patch@patchbox:~ $ cat /etc/systemd/logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandlePowerKeyLongPress=ignore
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#HandleSuspendKey=suspend
#HandleSuspendKeyLongPress=hibernate
#HandleHibernateKey=hibernate
#HandleHibernateKeyLongPress=ignore
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#StopIdleSessionSec=infinity

The folder /etc/triggerhappy/triggers.d doesn’t contain any file, it just an empty directory. Is that correct?

PS:
I tried activating HandlePowerKey=poweroff and also activated PowerKeyIgnoreInhibited=yes (by deleting the #), but still no reaction to the power button as well. :frowning:
journalctl -fstill reacts on pressing the power button with something like Feb 06 12:32:31 patchbox systemd-logind[741]: Power key pressed short.
What am I missing?

okay, the issue only occurs on X11. If I enable wayland (wayfire or labwc), the power button works as usual. i can live with that so far, but i’d rather like to use X11, because Waveform has a lot of GUI glitches under wayland, depending on the window size of the Waveform window (the bigger, the worse). If someone has an Idea… :wink: