Bug 461475

Summary: Login immediately after Logout may fail if systemd service stops too slowly
Product: [Plasma] plasmashell Reporter: Jolene K <jolene>
Component: Startup processAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: agurenko, bugseforuns, kde, nate
Priority: NOR    
Version First Reported In: 5.26.2   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jolene K 2022-11-05 23:54:11 UTC
SUMMARY
If using the systemd startup and a user service takes too long to shut down, a future login may fail.


STEPS TO REPRODUCE
1. Ensure Plasma uses the systemd startup
2. Have a systemd user service which is very slow to shutdown (like /bin/bash -c 'trap -- "" SIGINT SIGTERM; while true; do sleep 1000; done' in autostart, but the virtualbox guest additions work too)
3. Logoff and then login again very quickly (can use SDDM autologin for this) 

OBSERVED RESULT
Login fails with mouse cursor on black background.
session log says org.kde.startup: Could not start systemd managed Plasma session: "org.freedesktop.systemd1.TransactionIsDestructive" "Transaction for plasma-workspace-x11.target/start is destructive (graphical-session.target has 'stop' job queued, but 'start' is included in transaction)."

EXPECTED RESULT
Login works normally

ADDITIONAL INFORMATION
I believe that on logout, startplasma-{wayland,x11} should wait for graphical-session.target to stop instead of waiting for a DBUS name to disappear. I'll try to create a patch in the next few days.
Comment 1 Patrick Silva 2022-11-06 01:43:55 UTC
possibly duplicate of bug 450320
Comment 2 Bug Janitor Service 2022-11-10 00:10:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2318
Comment 3 Nate Graham 2025-10-24 18:17:37 UTC
Ah, this was fixed a year or so ago.