I am using Ubuntu Server 20.04.6 LTS over ssh. My packages are updated. If there is any other config info that would help, let me know.
I have been trying for hours to get my power button to shut off my server. I started by checking journalctl for systemd-logind. Systemd-logind does report "Power key pressed." when I press my power button. I read that you should set HandlePowerKey=poweroff
in the /etc/systemd/logind.conf
file. I did not have that file so I created it and added that line.
The file is:
[Login]
HandlePowerKey=poweroff
I restarted the systemd-logind service and pressed the power key but it still did not shut down the system. I have tried after rebooting as well. I do not have acpid installed.
This server has been in use for a year or so now. When I first started playing around with it, the power button did work, so something I did many months ago must have broken that functionality.
I did a little more digging and upon checking systemd-inhibit --list
, it appears that gdm is blocking hardware key presses. I'm not sure what exactly gdm is, but is it something I can change/remove?