https://bugs.kde.org/show_bug.cgi?id=528010
Bug ID: 528010
Summary: Plasma 6.8.2: Shutdown and reboot fail with
InteractiveAuthorizationRequired when plasma-shutdown
is D-Bus activated outside the active session
Classification: Plasma
Product: plasmashell
Version First 6.8.2
Reported In:
Platform: Gentoo Packages
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Session Management
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: 1.0
SUMMARY
=======
Plasma shutdown and reboot fail with InteractiveAuthorizationRequired when
plasma-shutdown is D-Bus activated outside the active graphical session.
SYSTEM INFORMATION
==================
Operating system: Gentoo Linux
Init system: OpenRC
Session management: elogind
Desktop: KDE Plasma 6.8.2 (Wayland)
Session manager: Legacy plasma_session (non-systemd)
Display managers tested: greetd and SDDM
STEPS TO REPRODUCE
==================
1. Start a Plasma Wayland session using OpenRC and elogind, with a persistent
user D-Bus session bus.
2. Select Restart or Shut Down from the Plasma application launcher.
3. Confirm the action.
ACTUAL RESULT
=============
Plasma successfully terminates KSMServer and KWin, but the requested shutdown
or reboot does not occur.
The screen remains black with a blinking cursor. The following processes remain
running:
- startplasma-wayland
- plasma_session
- plasma-shutdown
Debug instrumentation of LogindSessionBackend::reboot() reveals:
[SHUTDOWN-DEBUG] Calling reboot()
[SHUTDOWN-DEBUG] Sending Reboot(true) to elogind
[SHUTDOWN-DEBUG] Reboot failed:
org.freedesktop.DBus.Error.InteractiveAuthorizationRequired
Interactive authentication required.
[SHUTDOWN-DEBUG] reboot() returned
EXPECTED RESULT
===============
Plasma should successfully shut down or reboot the system when the user
initiating the action has permission to do so from the active graphical
session.
INVESTIGATION
=============
1. elogind permissions
CanPowerOff and CanReboot both return "yes".
The graphical session is correctly registered:
Type=wayland
Desktop=KDE
Class=user
Active=yes
State=active
No shutdown-blocking inhibitors were present.
2. Shutdown sequence
D-Bus monitoring confirms that:
- org.kde.Shutdown.logoutAndReboot() is received.
- KSMServer.closeSession() returns true.
- KWin.closeWaylandWindows() returns true.
- KSMServer.quit() completes.
- KWin.quit() completes.
- KWin releases org.kde.KWin.
The graphical session teardown is therefore successful.
3. D-Bus activation and Polkit authorization
The persistent user D-Bus daemon runs in an elogind background session.
When plasma-shutdown is D-Bus activated, it also runs in a background session:
UID=1000
PPID=1
CGroup=/4
Class=background
Checking authorization with:
pkcheck --action-id org.freedesktop.login1.reboot --process <PID>
Result for D-Bus-activated plasma-shutdown:
Exit code: 2 (authentication required)
Result for plasmashell in the active graphical session:
Exit code: 0 (authorized)
Starting plasma-shutdown manually from a terminal within the active Plasma
session produces:
UID=1000
Session=38
CGroup=/38
Polkit exit code: 0
However, prestarting plasma-shutdown is not a viable workaround, as the already
registered org.kde.Shutdown service can interfere with the graphical logout
dialog.
4. Missing error handling
LogindSessionBackend::reboot() currently contains:
void LogindSessionBackend::reboot()
{
m_login1->Reboot(true).waitForFinished();
}
The D-Bus reply is not checked.
When authorization fails, plasma-shutdown remains running in its Qt event loop
without completing the requested operation.
CONFIRMED WORKAROUND
====================
A temporary Polkit rule returning polkit.Result.YES for the following actions,
restricted to the affected user, resolves the issue:
- org.freedesktop.login1.reboot
- org.freedesktop.login1.reboot-multiple-sessions
- org.freedesktop.login1.power-off
- org.freedesktop.login1.power-off-multiple-sessions
After applying this rule, Plasma successfully reboots the system.
Debug output confirms:
[SHUTDOWN-DEBUG] Sending Reboot(true) to elogind
[SHUTDOWN-DEBUG] Reboot request succeeded
[SHUTDOWN-DEBUG] reboot() returned
POSSIBLE CAUSE
==============
The D-Bus-activated plasma-shutdown process appears to perform the final
power-management operation under the authorization context of an elogind
background session rather than the active graphical session from which the
shutdown was requested.
After the graphical session has been terminated, interactive Polkit
authentication is no longer available.
SUGGESTED IMPROVEMENTS
======================
- Ensure the shutdown/reboot authorization is obtained before the graphical
session is terminated, or otherwise preserve the necessary authorization for
the final operation.
- Check and report D-Bus errors returned by LogindSessionBackend::shutdown()
and reboot().
- Avoid leaving plasma-shutdown running indefinitely when the final
power-management operation fails.
ADDITIONAL INFORMATION
======================
The issue occurs with both greetd and SDDM.
The legacy non-systemd Plasma session path is used. Plasma correctly handles
the absence of org.freedesktop.systemd1 and falls back to its legacy session
shutdown path.
Related: bug 525911 (similar shutdown symptoms, different confirmed failure
mechanism).
--
You are receiving this mail because:
You are watching all bug changes.