Bug 457149

Summary: Plasma start with systemd breaks certain autostart file
Product: [Plasma] plasmashell Reporter: Weng Xuetian <wengxt>
Component: Startup processAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde, nate
Priority: NOR    
Version: 5.25.3   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
URL: https://github.com/systemd/systemd/issues/18791
Latest Commit: Version Fixed In:

Description Weng Xuetian 2022-07-26 06:28:47 UTC
Right now, plasma autostart relies on systemd's xdg autostart generator.

There are certain cases that is not handled with current mechanism. For the desktop file with X-systemd-skip or X-GNOME-Autostart-Phase (based on the doc, https://www.freedesktop.org/software/systemd/man/systemd-xdg-autostart-generator.html ), the service won't be generated, but also it doesn't mean they should not be started. Those should go through the traditional autostart code and be started.

Right now startplasma would just skip all of such desktop file that is not generated by systemd.
Comment 1 David Edmundson 2022-07-26 08:43:38 UTC
> X-systemd-skip 

That's very deliberate. It's used if you also provide explicit service files, something like plasmashell. 
Including them would mean starting the same thing twice which would be extremely bad.

X-gnome-autostart-phase is a real problematic situation.  We do have an upstream bug report:
https://github.com/systemd/systemd/issues/18791

>Those should go through the traditional autostart code and be started.

We should not. It would create a fragmented absolute mess with a hack. 

If I change systemd behaviour for the x-gnome-autostart does that solve everything
Comment 2 David Edmundson 2022-07-26 08:57:15 UTC
out of curiosity which .desktop file were you affected by? Was it ibus-daemon?
Comment 3 Weng Xuetian 2022-07-30 01:03:23 UTC
(In reply to David Edmundson from comment #2)
> out of curiosity which .desktop file were you affected by? Was it
> ibus-daemon?

I don't use ibus. This https://github.com/fcitx/fcitx/blob/eb54e2b244e93d695c83c1f3bdbe6ee83155058a/data/fcitx-autostart.desktop.in#L12
It just contains the  "X-GNOME-Autostart-Phase" due to some random reason.  Maybe because I want it start after the panel is loaded in GNOME 2 times. I don't know if it does anything good, but it was just there and suddenly break by plasma updade.  (Also I don't know why I remove this line in fcitx5 which make it unaffected luckily)

So to me the situation as fcitx dev is not that bad, because mainstream distro (debian/ubuntu/fedora) does not use fcitx's own xdg autostart for input method. Right now the most affected distro is arch linux, so I just release a new version of old fcitx 4 in emergency simply avoid breakage by plasma.

I'm actually reading the bug and they even find fcitx is affected? but no one wants to just open a bug to fcitx upstream? 
https://github.com/systemd/systemd/issues/18791#issuecomment-788922727

I have no idea about X-system-skip, not sure what's the semantics of it.
Comment 4 Nate Graham 2023-12-08 19:50:58 UTC
It appears this is just https://github.com/systemd/systemd/issues/18791, which was fixed in Systemd a while ago.