Bug 433538 - systemdBoot: autostart items not launched (xdg-user-dirs)
Summary: systemdBoot: autostart items not launched (xdg-user-dirs)
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.21.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL: https://github.com/systemd/systemd/is...
Keywords:
: 460841 461128 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-24 16:02 UTC by Rex Dieter
Modified: 2022-10-29 11:05 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rex Dieter 2021-02-24 16:02:00 UTC
Testing on both fedora 33 and fedora34 with systemdBoot=true feature enabled, seems at least some (or all?) autostart items in /etc/xdg/autostart do not get processed or started.

The first and primary symptom we noticed was that XDG-related dirs not getting created for new users, which highlighted that this item doesn't run at least:
/etc/xdg/autostart/xdg-user-dirs.desktop

I tried adjusting plasma-workspace@.target to move xdg-desktop-autostart.target from Requires= to Wants=, but that didn't seem to make any difference.
Comment 1 Alois Wohlschlager 2021-02-24 20:19:32 UTC
This is due to xdg-autostart-generator not supporting startup phases yet. If the desktop file contains the X-GNOME-Autostart-Phase key, the unit will not be generated [1].

[1]: https://github.com/systemd/systemd/blob/c0267a592a2d44c89874249573d53a456ea3756b/src/xdg-autostart-generator/xdg-autostart-service.c#L558
Comment 2 Rex Dieter 2021-02-24 21:43:07 UTC
So kde/plasma is just going to leave that broken?

Wasn't a problem when plasma implemented the xdg autostart internally (of course), may have to leave at least part of that enabled for items like this?
Comment 3 Rex Dieter 2021-02-24 22:19:04 UTC
Filed this with systemd,
https://github.com/systemd/systemd/issues/18791
Comment 4 Kevin Kofler 2021-02-26 20:22:09 UTC
The weird thing is that systemd apparently has no problems silently ignoring X-KDE-autostart-phase and just proceeding as if it were not there (at least, I do not see it being processed anywhere in that source file), but it reacts to X-GNOME-Autostart-Phase by ignoring the whole service entirely.
Comment 5 Marco 2021-03-22 08:38:10 UTC
I have the same issue and it does not seem to be related to not generated units. Actually, the units *are* generated (I can see them in "generated.late"), but for some reasons the corresponding applications are not started.
This happens specifically with Dropbox and Insync (other applications like Thunderbird work fine). If I set systemdBoot to false, these applications run on startup just fine.
Here are their .desktop files as a reference:

--- Dropbox ---
[Desktop Entry]
Name=Dropbox
GenericName=File Synchronizer
Comment=Sync your files across computers and to the web
Exec=dropbox start -i
Terminal=false
Type=Application
Icon=dropbox
Categories=Network;FileTransfer;
Keywords=file;synchronization;sharing;collaboration;cloud;storage;backup;
StartupNotify=false
X-GNOME-Autostart-Delay=10

--- Insync ---
[Desktop Entry]
Categories=Network;
Comment=Launch Insync
Exec=insync start
GenericName=Insync
Icon=insync
Name=Insync
Terminal=false
TryExec=insync
Type=Application
Version=1.0
Comment 6 David Edmundson 2021-03-22 10:08:30 UTC
Sounds like a different bug:

Do you know if  "dropbox start -i" forks into the background?
same for "insync start"

If so that's a known other bug. They do start, but then the main process quits so we kill the whole service (also now fixed upstream)
Comment 7 Nate Graham 2021-03-22 11:52:50 UTC
(In reply to David Edmundson from comment #6)
> Sounds like a different bug:
> 
> Do you know if  "dropbox start -i" forks into the background?

I can confirm that it does. What's the upstream bug? https://github.com/systemd/systemd/issues/18791?
Comment 8 Nate Graham 2021-03-22 11:55:16 UTC
Actually that may be a dirty lie. It does not.

What I see is that the `dropbox` process is in fact autostarted and seems to be working, but it has no item in the system tray when using systemd startup. If I kill the autostarted process and run it manually, I see the tray item.
Comment 9 Marco 2021-03-22 12:14:53 UTC
In my case, I do not even have the dropbox process running (neither for insync).
Comment 10 Marco 2021-03-22 12:17:04 UTC
and, after running dropbox start -i, or insync start, I get back my console, so they seem to fork in the background.
Comment 11 Marco 2021-03-23 07:23:47 UTC
Can anyone point me to the bug that has been fixed upstream? (the one related to Dropbox and other apps forking in the background not working)
Comment 12 Jonathan Riddell 2022-10-24 11:46:59 UTC
*** Bug 460841 has been marked as a duplicate of this bug. ***
Comment 13 Rik Mills 2022-10-29 11:02:49 UTC
*** Bug 461128 has been marked as a duplicate of this bug. ***