systemd-logind only intercepts power button after suspend cycle

Asked by zak-xyzzy

I have a fresh installation of xubuntu 19.04, with all subsequent updates applied, on a Lenovo x120e.

From a fresh boot, I run: journalctl -f
Then press the power button.

Expected behavior is "May 20 21:47:17 xyz systemd-logind[513]: Power key pressed" from journalctl
and whatever action is defined in the XFCE4 power manager (presently set to "ignore")

Actual behavior is system immediately reboots.

Plot twist: If I boot fresh, then run "systemctl suspend", then resume from suspended state by pressing the power button, wait for it all to come back, and THEN repeated the steps above, I get the correct log message from systemd-logind, including suspending if that's how XFCE4 power settings are set.

In summary, either something is pre-empting logind from intercepting the power button press or the "hook", is not registered, from a fresh boot until a suspend/resume cycle is manually initiated.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
zak-xyzzy (zak-xyzzy) said :
#1

Behavior is identical on 18.04.2.
Happens on another x120e so it's not something weird with this instance of the machine.

Revision history for this message
zak-xyzzy (zak-xyzzy) said :
#2

When the behavior succeeds (ie, the non failing case), the following 4 lines/events are produced by acpi_listen upon a power button press-release:

button/power PBTN 00000080 00000000
button/power PNP0C0C:00 00000080 00000001
button/power PBTN 00000080 00000000
button/power LNXPWRBN:00 00000080 00000001

Where events 1-2 happen during the button depress, and events 3-4 happen upon button release.

When the laptop "immediately restarts" upon pressing the button (IE, does not intercept the events properly), ONLY events 1-2 are reported. Which makes some sense because the reboot is initiated before the button is released. So the PBTN and PNP0C0C events ARE reported through the pipeline.

Revision history for this message
zak-xyzzy (zak-xyzzy) said :
#3

Another thing that happens is that the "Suspend/Shutdown/Reboot/Logout" menu pops up twice (ie, it reoccurs after the first is dismissed) when the power button is pressed and the laptop/OS is in a state that it doesn't reboot immediately. Speculate that this is due to the two PBTN events, one for down, one for up.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
zak-xyzzy (zak-xyzzy) said :
#5

Issue persists. Suspend function worked fine on much much older version of Ubuntu (10?).

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.