System Issue Fix Record: Power Button Does Not Shut Down from Lock Screen/Login Screen
Record Date: 2026-08-04
1. Issue Description
Pressing the power button has no response on the lock screen or user login screen (greeter), making shutdown impossible; shutdown only works during a normal desktop session.
2. System Environment
| Item | Value |
|---|---|
| Operating System | openEuler 25.09 |
| Desktop Environment | UKUI (X11) |
| Display Manager | LightDM + ukui-greeter |
| systemd | v255-54.oe2509 |
3. Root Cause Analysis
The drop-in configuration file /etc/systemd/logind.conf.d/power-ignore.conf sets the power button handling to:
[Login]
HandlePowerKey=ignore
Since systemd drop-in configurations take precedence over the main configuration file /etc/systemd/logind.conf, where HandlePowerKey=poweroff is set, the effective power button behavior becomes ignore, resulting in no response when pressing the power button.
Verification steps:
- The main configuration
/etc/systemd/logind.confcorrectly setsHandlePowerKey=poweroff, andacpidis not running (no conflict withlogind). systemd-analyze cat-config systemd/logind.confconfirms the drop-in overrides the main config, with effective valueignore.- D-Bus query confirms the active value:
busctl get-property ... HandlePowerKey→s "ignore". loginctl(via D-BusListInhibitors) shows no process holds ahandle-power-keyinhibitor, ruling out process-level interception — this is purely a configuration issue.
4. Fix Steps
Modify /etc/systemd/logind.conf.d/power-ignore.conf:
[Login]
# Power button shutdown: Fix inability to shut down from lock screen/login screen (was 'ignore', overriding main config's 'poweroff')
HandlePowerKey=poweroff
# Even if processes (e.g., lock screen component) inhibit the power key, still perform shutdown to ensure lock/login screens remain usable
PowerKeyIgnoreInhibited=yes
Restart logind to apply the changes:
systemctl restart systemd-logind
5. Verification Results
| Check Item | Result |
|---|---|
| Effective HandlePowerKey (D-Bus) | s "poweroff" |
| Effective merged config (cat-config) | HandlePowerKey=poweroff, PowerKeyIgnoreInhibited=yes |
| logind listening to power button | Log shows Watching system buttons on /dev/input/event0 (Power Button) |
| systemd-logind service status | active, no errors |
| Session status | Normal, unaffected |
6. Notes and Rollback
PowerKeyIgnoreInhibited=yesensures that even if the lock screen component (e.g.,ukui-screensaver-backend) later claims inhibition,logindwill still execute shutdown — guaranteeing usability of the lock/login screen.- The trade-off is that in the desktop session, shutdown will bypass the application/desktop environment’s “shutdown confirmation dialog” and proceed directly.
- To revert: Remove or comment out the
HandlePowerKey=poweroffandPowerKeyIgnoreInhibited=yeslines in the drop-in file, then restartsystemd-logind.