2024-01-22 11:45 PM
Hi,
I have an STM32MP1 MPU based module running OpenSTLinux.
Whenever I press the power button, this gets recorded in journalctl:
root@STLinux:~# journalctl --unit systemd-logind --follow
-- Logs begin at Fri 2020-02-07 15:50:56 UTC. --
Jan 22 15:15:37 STLinux systemd-logind[919]: Session c1 logged out. Waiting for processes to exit.
Jan 22 15:15:38 STLinux systemd[1]: Stopping Login Service...
Jan 22 15:15:38 STLinux systemd-logind[919]: Removed session c1.
Jan 22 15:15:38 STLinux systemd[1]: systemd-logind.service: Succeeded.
Jan 22 15:15:38 STLinux systemd[1]: Stopped Login Service.
-- Reboot --
Jan 22 15:15:45 STLinux systemd[1]: Starting Login Service...
Jan 22 15:15:48 STLinux systemd-logind[921]: Watching system buttons on /dev/input/event0 (pmic_onkey)
Jan 22 15:15:48 STLinux systemd-logind[921]: New seat seat0.
Jan 22 15:15:48 STLinux systemd[1]: Started Login Service.
Jan 22 15:15:56 STLinux systemd-logind[921]: New session c1 of user root.
Jan 23 07:05:00 STLinux systemd-logind[921]: Power key pressed.
Jan 23 07:05:02 STLinux systemd-logind[921]: Power key pressed.
Jan 23 07:05:05 STLinux systemd-logind[921]: Power key pressed.
Jan 23 07:05:07 STLinux systemd-logind[921]: Power key pressed.
But nothing else happens.
How can I make my system shut down when I press the power button?
This is /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.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=yes
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
HandlePowerKey=poweroff
HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
Thanks.
Solved! Go to Solution.
2024-09-13 05:04 AM
I fixed this by installing acpid and creating a config file /etc/acpi/events/powerbtn containing:
event=button/power
action=/sbin/poweroff
(Restart acpid with systemctl restart acpid for the configuration to take effect.)
2024-05-16 06:45 AM
I'm still stuck on this. If anyone needs more information, I'd be happy to provide this.
2024-09-13 05:04 AM
I fixed this by installing acpid and creating a config file /etc/acpi/events/powerbtn containing:
event=button/power
action=/sbin/poweroff
(Restart acpid with systemctl restart acpid for the configuration to take effect.)