SUMMARY Some of my startup scripts/applications fail to start with systemd boot enabled, so I have disabled it by creating "~/.config/startkderc" containing: [General] systemdBoot=false This worked without issue in Plasma 5, but in Plasma 6, disabling systemd boot causes logout to no longer work. Under X11, logging out stalls at a black screen with a mouse cursor. Under Wayland, logging out appears to do nothing. After trying to log out in Wayland, the shutdown and restart buttons will now also do nothing for the rest of the session. STEPS TO REPRODUCE 1. Disable systemd boot. Here's a quick command to create/edit `startkderc`: kwriteconfig5 --file startkderc --group General --key systemdBoot false 2. Restart and log into the desktop. 3. Click on the plasma menu, then choose "Log Out", and confirm on the following logout screen. OBSERVED RESULT Stuck on black screen with mouse cursor (X11) or nothing appears to happen, with shutdown, restart buttons becoming broken for the rest of the session (Wayland). EXPECTED RESULT The user should be logged out and back at the SDDM login screen. SOFTWARE/OS VERSIONS Linux: KDE neon User Edition 6.0 KDE Plasma Version: 6.0.0 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 ADDITIONAL INFORMATION Bug confirmed on three separate KDE neon installs (1 desktop, 1 laptop, 1 VirtualBox).
Can reproduce all of those issues on Wayland, Did not test X11.
Found it: ``` auto msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"), QStringLiteral("/org/freedesktop/systemd1"), QStringLiteral("org.freedesktop.systemd1.Manager"), QStringLiteral("StopUnit")); msg << QStringLiteral("graphical-session.target") << QStringLiteral("fail"); QDBusReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(msg); if (!reply.isValid()) { do the legacy path ``` If systemd is available, but we're not using the systemd boot, that DBus call is perfectly legit so it doesn't fail. It just does nothing. So we never enter the legacy path. We'll need to find a way to distinguish those two
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4095
Git commit 41629e86035e341bb4dea662236aefdc274e7c30 by David Edmundson. Committed on 22/03/2024 at 13:49. Pushed by davidedmundson into branch 'master'. plasma-shutdown: Correclty detect if we're using the legacy session We need different shutdown paths for the systemd and legacy boot. The current code worked by making the systemd call to end the session and checking the return status. This worked for handling the situation where systemd is not installed. It does not capture the case where the systemd boot is explicitly disabled. The call successfully does nothing. Instead replace with an explicit check that our target is activated. Also change to end the plasma-workspace.target as that's semantically more correct given it's the one we started. This is bound to the graphical-session so it ends up being the same thing. M +29 -6 startkde/plasma-shutdown/shutdown.cpp M +1 -0 startkde/plasma-shutdown/shutdown.h https://invent.kde.org/plasma/plasma-workspace/-/commit/41629e86035e341bb4dea662236aefdc274e7c30
Git commit b0c3c66fc04a7743c6c61d54e1d825349de5d8b6 by Nate Graham, on behalf of David Edmundson. Committed on 25/03/2024 at 21:25. Pushed by ngraham into branch 'Plasma/6.0'. plasma-shutdown: Correclty detect if we're using the legacy session We need different shutdown paths for the systemd and legacy boot. The current code worked by making the systemd call to end the session and checking the return status. This worked for handling the situation where systemd is not installed. It does not capture the case where the systemd boot is explicitly disabled. The call successfully does nothing. Instead replace with an explicit check that our target is activated. Also change to end the plasma-workspace.target as that's semantically more correct given it's the one we started. This is bound to the graphical-session so it ends up being the same thing. (cherry picked from commit 41629e86035e341bb4dea662236aefdc274e7c30) M +29 -6 startkde/plasma-shutdown/shutdown.cpp M +1 -0 startkde/plasma-shutdown/shutdown.h https://invent.kde.org/plasma/plasma-workspace/-/commit/b0c3c66fc04a7743c6c61d54e1d825349de5d8b6