https://bugs.kde.org/show_bug.cgi?id=526151

            Bug ID: 526151
           Summary: Any D-Bus call to org.kde.Shutdown starts
                    plasma-shutdown, which then never exits, and
                    PowerDevil refuses to suspend for the rest of the
                    session
    Classification: Plasma
           Product: plasmashell
      Version First 6.7.5
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Power management & brightness
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

SuspendSession::triggerImpl() (daemon/actions/bundled/suspendsession.cpp) skips
suspend when the name org.kde.Shutdown is registered on the session bus:

    if
(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.Shutdown")))
{
        qCDebug(POWERDEVIL) << "Not suspending because a shutdown is in
progress";
        return;
    }

But org.kde.Shutdown is D-Bus activatable
(/usr/share/dbus-1/services/org.kde.Shutdown.service,
Exec=/usr/bin/plasma-shutdown), and plasma-shutdown only quits during a logout.
So any
client that merely touches the name (introspection, a D-Bus browser such as
D-Spy or
qdbusviewer, a script) starts plasma-shutdown, which stays running for the rest
of the
session. From then on, suspend requests handled by PowerDevil do nothing,
silently
(the message is only qCDebug).

STEPS TO REPRODUCE
1. In a Plasma 6 session: busctl --user status org.kde.Shutdown   -> not
registered
2. busctl --user introspect org.kde.Shutdown /Shutdown
3. busctl --user status org.kde.Shutdown   -> PID of plasma-shutdown,
   UserUnit=dbus-:[email protected]; still there minutes later
4. Press the Sleep key (or wait for idle suspend)

OBSERVED RESULT
The system does not suspend. With debug logging enabled for org.kde.powerdevil,
PowerDevil logs "Not suspending because a shutdown is in progress".
Suspend works again after: systemctl --user stop
'dbus-:[email protected]'

EXPECTED RESULT
Starting plasma-shutdown by D-Bus activation, without a logout request, should
not
block suspend.

Possible fixes: PowerDevil could ask for an explicit "shutdown in progress"
state
instead of relying on the name being registered, or plasma-shutdown could
register the
name only when a logout actually starts (or quit when idle).

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44 (KDE Plasma)
KDE Plasma Version: 6.7.5 (powerdevil-6.7.5, plasma-workspace-6.7.5)
Kernel Version: 7.2.7-200.fc44.x86_64
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Related: bug 189456 (suspend while shutting down), which this check presumably
addresses. The check itself is useful; the problem is only that registering the
name
does not mean a shutdown is in progress.
Checked against powerdevil master (691515e): the check is unchanged.
plasma-shutdown
(startkde/plasma-shutdown/shutdown.cpp) registers org.kde.Shutdown in its
constructor
and calls qApp->quit() only on the logout/cancel paths.
Found while checking D-Bus services on the system; the analysis was done with
AI
assistance, and I reproduced the steps above on my machine.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to