openEuler 25.09: Cannot shut down by pressing power button on lock/login screen

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:

  1. The main configuration /etc/systemd/logind.conf correctly sets HandlePowerKey=poweroff, and acpid is not running (no conflict with logind).
  2. systemd-analyze cat-config systemd/logind.conf confirms the drop-in overrides the main config, with effective value ignore.
  3. D-Bus query confirms the active value: busctl get-property ... HandlePowerKeys "ignore".
  4. loginctl (via D-Bus ListInhibitors) shows no process holds a handle-power-key inhibitor, 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" :white_check_mark:
Effective merged config (cat-config) HandlePowerKey=poweroff, PowerKeyIgnoreInhibited=yes :white_check_mark:
logind listening to power button Log shows Watching system buttons on /dev/input/event0 (Power Button) :white_check_mark:
systemd-logind service status active, no errors :white_check_mark:
Session status Normal, unaffected :white_check_mark:

6. Notes and Rollback

  • PowerKeyIgnoreInhibited=yes ensures that even if the lock screen component (e.g., ukui-screensaver-backend) later claims inhibition, logind will 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=poweroff and PowerKeyIgnoreInhibited=yes lines in the drop-in file, then restart systemd-logind.
1 Like