Created attachment 135977 [details] xsession-errors SUMMARY Enabling systemdBoot via 'kwriteconfig5 --file startkderc --group General --key systemdBoot true' completely breaks startplasma-x11 with a 'startkde' error occuring every time you log in from that point onwards until you disable systemdBoot. STEPS TO REPRODUCE 1. Run 'writeconfig5 --file startkderc --group General --key systemdBoot true' 2. Log out 3. Log in again OBSERVED RESULT startkde: Could not start Plasma session. appears in an X11 dialog, closing that logs you out. KWin and co. don't start. EXPECTED RESULT The Desktop works fine. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: KDE neon 5.21.0 (available in About System) KDE Plasma Version: 5.21.0 KDE Frameworks Version: 5.79.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION No useful information in the .xsession-errors file, except for the message in the X11 dialog. Running it via manual startx /usr/bin/startplasma-x11 causes it to yield the same 'startkde: Starting up...' and 'startkde: Could not start Plasma session.' output as in the .xsession-errors log. The plasma-plasmashell.service service seems to be disabled but enabling it does nothing to change the situation. Furthermore, systemctl --user status plasma-plasmashell.service shows that it never attempted to run the service. Disabling systemdBoot in the config file resolves the issue.
Can I have the results of "journalctl --user" after logging in
Created attachment 135981 [details] journalctl --user
Neither show a lot. I've made a MR to add some more debug for future. Can you run: "qdbus org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.StartUnit plasma-workspace@x11.target fail" from konsole. It can be called whilst systemdBoot is disabled.
Error: org.freedesktop.systemd1.NoSuchUnit Unit xdg-desktop-autostart.target not found.
Can I see your ~/.config/startkderc please?
I do have xdg-desktop-autostart.target in Requires rather than Wants, which is what makes it fatal if not found What puzzles me is we have a check for xdg-desktop-portal, and we should opt-out of the systemd boot if it's not available (unless forced)
(In reply to David Edmundson from comment #5) > Can I see your ~/.config/startkderc please? There is none, nor is there one in /etc/xdg and co. Upon applying the setting, this is local startkderc: [General] systemdBoot=true
Urgh, found it. bool hasSystemdService(QString) doesn't work as intended. In the correct case: qdbus --literal org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.ListUnitsByNames xdg-desktop-autostart.target I get a blob as expected: [Argument: a(ssssssouso) {[Argument: (ssssssouso) "xdg-desktop-autostart.target", "Startup of XDG autostart applications", "loaded", "active", "active", "", [ObjectPath: /org/freedesktop/systemd1/unit/xdg_2ddesktop_2dautostart_2etarget], 0, "", [ObjectPath: /]]}] ------ In testing I had used a random string: qdbus --literal org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.ListUnitsByNames randomMissingService [Argument: a(ssssssouso) {}] which returns an empty array. In this function I test for an empty array, thinking that was a nice quick and safe solution. ------ In practice, if something is well formed, what I get is: qdbus --literal org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.ListUnitsByNames randomMissingService.service [Argument: a(ssssssouso) {[Argument: (ssssssouso) "randomMissingService.service", "randomMissingService.service", "not-found", "inactive", "dead", "", [ObjectPath: /org/freedesktop/systemd1/unit/randomMissingService_2eservice], 0, "", [ObjectPath: /]]}]
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/663
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/688
Git commit 1c7e3064d88d13fb4a03aba41bd6d5ac7ca832e7 by Henri Chain, on behalf of David Edmundson. Committed on 03/03/2021 at 14:41. Pushed by davidedmundson into branch 'master'. Fix query of StartPlasma::hasSystemdService ListUnitByNames did not quite work as the author (me) expected. Whilst a search for "adsfasf" yeilded an empty list a well-formed name like "asdfasdf.service" would return a result to say that service was not loaded. This means our runtime detection of xdg-autostart-generator failed. By using ListUnitFilesByPatterns we can filter on the status in the query, meaning this code works again. We also can query the case of it being available but explicitly disabled. M +3 -3 startkde/startplasma.cpp https://invent.kde.org/plasma/plasma-workspace/commit/1c7e3064d88d13fb4a03aba41bd6d5ac7ca832e7
Git commit bbe0f91070ac7235066b28e57f9971ac1a4f821e by David Edmundson. Committed on 03/03/2021 at 16:02. Pushed by davidedmundson into branch 'Plasma/5.21'. Fix query of StartPlasma::hasSystemdService ListUnitByNames did not quite work as the author (me) expected. Whilst a search for "adsfasf" yeilded an empty list a well-formed name like "asdfasdf.service" would return a result to say that service was not loaded. This means our runtime detection of xdg-autostart-generator failed. By using ListUnitFilesByPatterns we can filter on the status in the query, meaning this code works again. We also can query the case of it being available but explicitly disabled. (cherry picked from commit 1c7e3064d88d13fb4a03aba41bd6d5ac7ca832e7) M +3 -3 startkde/startplasma.cpp https://invent.kde.org/plasma/plasma-workspace/commit/bbe0f91070ac7235066b28e57f9971ac1a4f821e