Bug 450447

Summary: Synology Drive Client doesn't autostart
Product: [Plasma] plasmashell Reporter: Syiad <syiad.al-duri>
Component: Startup processAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: comp.keith55, kde, m.b.pohl, nate
Priority: NOR Keywords: regression
Version First Reported In: 5.25.5   
Target Milestone: 1.0   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Output of systemd-cgls after login
Session log from affected Wayland session
synology autostart file

Description Syiad 2022-02-17 12:11:30 UTC
SUMMARY
The Synology Drive Client doesn't autostart with Plasma 5.24. It did previously up to Plasma 5.23.


STEPS TO REPRODUCE
1. Start Plasma session (Wayland)
2. 
3. 

OBSERVED RESULT
Synology Drive Client not showing in systray. Need to manually start it.

EXPECTED RESULT
Synology Drive Client starting automatically and showing up in systray. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 21.10

KDE Plasma Version: 5.24.1 (Problem was also present with 5.23.90 & 5.24)
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2022-02-17 23:18:43 UTC
Does it have an entry in System Settings > Startup and Shutdown > Autostart?
Comment 2 Syiad 2022-02-18 11:23:05 UTC
Yes, there is an entry with the command 'synology-drive autostart'. It has been generated from the Synology Drive Settings and it used to work up until KDE 5.23.90.
Comment 3 David Edmundson 2022-02-23 23:42:02 UTC
Please attach the session log.
Comment 4 David Edmundson 2022-02-23 23:42:31 UTC
and/or output of  systemd-cgls after login
Comment 5 Syiad 2022-02-24 15:32:19 UTC
Created attachment 147100 [details]
Output of systemd-cgls after login

The output of systemd-cgls after login is attached. Where would I find the session log, please?
Comment 6 Syiad 2022-02-24 15:36:01 UTC
The autostart worked with 5.23. It stopped working when 5.23.90 was installed. It started working again, without any changes to the autostart config, after purging 5.23.90, i.e. reverting back to 5.23.

So, it seems something affecting autostart has changed after 5.23.
Comment 7 David Edmundson 2022-02-24 15:47:59 UTC
~/.local/share/sddm/wayland-session.log
Comment 8 Syiad 2022-02-24 15:55:52 UTC
Created attachment 147102 [details]
Session log from affected Wayland session

Thanks, session log is attached now.
Comment 9 Syiad 2022-04-05 14:31:54 UTC
No idea what caused it or how it was fixed, but it works again from 5.24.3 onwards.
Comment 10 Syiad 2022-09-13 15:51:17 UTC
It was fixed with 5.24.3, but it resurfaced with 5.25.4.
Comment 11 Nate Graham 2022-09-13 15:56:25 UTC
Can you attach the .desktop file that wants to be autostarted? It'll be in /etc/xdg/autostart/ or ~/.config/autostart/.
Comment 12 Syiad 2022-09-13 16:07:22 UTC
Created attachment 152030 [details]
synology autostart file

There is a link in ~/.config/autostart. It points to /opt/Synology/SynologyDrive/synology-drive-autostart.

Maybe 5.25 has a problem with links  in ~/.config/autostart? The other files in that directory (yakuake and keepassxc) get started OK; they are not links.
Comment 13 Syiad 2022-09-13 16:08:14 UTC
.
Comment 14 Nate Graham 2022-09-13 16:14:14 UTC
Can you give it a try by copying the file there?
Comment 15 Syiad 2022-09-13 16:58:45 UTC
OK, here's what I did:
1. Move the link "synology-drive-autostart.desktop" from ~/.config/autostart to somewhere else.
2. Copy the link target "synology-drive-autostart" to ~/.config/autostart
3. Rename the file "synology-drive-autostart" in ~/.config/autostart to "synology-drive-autostart.desktop"
4. Reboot

Result: synology drive still does not autostart.
Conclusion: The fact that there used to be a link in ~/.config/autostart is not the cause for the problem.

I can manually start synology drive by clicking on the file "synology-drive-autostart.desktop" in ~/.config/autostart and selecting 'execute'. So the file seems to work; it just doesn't get executed at startup.
Comment 16 Nate Graham 2022-09-13 17:40:03 UTC
Thanks for the info!

From the wayland log, looks like it's doing the right thing:

> org.kde.plasma.session: Starting autostart service  "/home/syiad/.config/autostart/synology-drive-autostart.desktop" ("/usr/bin/synology-drive", "autostart")
Comment 17 Syiad 2022-10-21 11:41:14 UTC
Somehow the problem has disappeared with Kubuntu 22.10.
Comment 18 Markus 2022-12-17 00:52:14 UTC
For anyone still having this issue, I found a workaround. Create a script which starts synology drive client and add a sleep infinity at the end.  Add the script to your autostart. It's not pretty but it works for me. I've tried shorter sleeps, but this causes the drive client to close after the sleep is over.

My script looks like this:
#! /bin/sh

synology-drive autostart 
sleep infinity
Comment 19 Keith 2024-04-25 02:03:05 UTC
This bug has reappeared under Plasma 6.0.4. The fix supplied by Markus worked. The Synology client adds a link in autostart to its .desktop when it runs. I added a login script to autostart and tried various options to spawn a separate task which made no difference. The initial task must remain for the Synology client to run. The same issue occurs for my Ubuntu Gnome PC, so not just KDE.
#! /bin/bash
#have tried:
# /usr/bin/synology-drive autostart
# nohup synology-drive autostart &
# synology-drive autostart & disown
#the Markus fix:
synology-drive autostart
sleep infinity
Comment 20 Keith 2024-04-25 03:45:03 UTC
My previous comment was for the package from Synology. As a further test, this was replaced by the FlatPack version and autostart no longer worked. The Synology Client creates the autostart link when it first runs but FlatPack uses a different folder structure. I copied the Synology Drive Client "ponts to" string from Application launcher and created a link  ~/.config/autostart/SynologyClient.desktop pointing to this string. The client now autostarts.