Summary: | Plasma on Wayland didn't start with a systemd error "user@1000.service: Failed to attach to cgroup /user.slice/user-1000.slice/user@1000.service: Device or resource busy" after logging out | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Matt Fagnani <matt.fagnani> |
Component: | Startup process | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kde, melechtna, nate, plasma-bugs, rdieter |
Priority: | NOR | ||
Version: | 5.21.2 | ||
Target Milestone: | 1.0 | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/-/commit/6ce8f434139f47e6a71bf0b68beae92be8845ce4 | Version Fixed In: | |
Sentry Crash Report: |
Description
Matt Fagnani
2021-03-14 16:49:27 UTC
I've continued to see this problem when I've logged out of Plasma 5.21.4 with KF 5.80.0 and logged in within about 40 seconds. If I logged in again after about 40-60 seconds, then Plasma started normally. When I rebooted or shut down from Plasma, a systemd message like "A stop job is running for User Manager for UID 1000" was shown for 40-60 seconds before the reboot or shutdown happened most of the time. I noticed in the KF 5.81.0 changelog for kded https://kde.org/announcements/frameworks/5/5.81.0/ the commit "make kded shut down cleanly during systemd session teardown" https://invent.kde.org/frameworks/kded/-/commit/96aa058b2b70bc19484e649b5bfcbb86d36336ff I changed /usr/lib/systemd/user/plasma-kded.service like in that commit by adding the line PartOf=graphical-session.target I logged in and out multiple times after that making that change, kded5 didn't abort during logout according to coredumpctl. Plasma started normally each time I logged in again within 10 seconds of logging out. That commit might be sufficient to avoid this problem. kwalletd5 still aborted when logging out, though kwalletd5 appears to just have a dbus-activated systemd service /usr/share/dbus-1/services/org.kde.kwalletd5.service and not a user session one like kded. I can confirm that this issue very much stems from plasma-dbus-run-session-if-needed seeming to have no idea of the dbus session is needed. The best solution I've been able to come too, and I'm apparently not the only one, https://bugzilla.redhat.com/show_bug.cgi?id=1897717 Is to modify the plasmawayland.desktop in /usr/share/wayland-sessions/ to simply throw out the detector script and just run dbus-run-session instead, then plasma starts normally. So clearly whatever this is doing drs= if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ] then drs=dbus-run-session fi exec ${drs} "$@" Doesn't do its job. Git commit 6ce8f434139f47e6a71bf0b68beae92be8845ce4 by David Edmundson. Committed on 29/09/2023 at 16:31. Pushed by davidedmundson into branch 'master'. Use systemd to handle more of the shutdown Previously we killed kwin manually, then tried to exit the session. This is racey as kwin will close all connections, before systemd has realised that the session is ending this can cause all apps to restart. Also closing plasma-workspace-wayland.target is ineffective, closing the graphical-session implicitly brings down the session more explicitly. It'll close the other targets and services. Related: bug 473824, bug 409088, bug 450531, bug 451939, bug 450320 Tested by looking at `coredumpctl list` after a logout and seeing it go from 10 entries of silly aborts restarting without a display server to 3, with different unrelated causes. M +12 -4 startkde/plasma-shutdown/shutdown.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/6ce8f434139f47e6a71bf0b68beae92be8845ce4 |