Kill syncthing on logout


I’m running Gnome on Fedora, and I autostart syncthing on login by placing the following desktop file in ~/.config/autostart.

[Desktop Entry]
Comment=Background Syncthing Node
Exec=syncthing --no-browser

This works fine, but when I logout, syncthing stays running in the background. Is there a way to make syncthing more “attached” to my graphical session so that when the session dies, so does syncthing?

I only care about this because my /home is provide via NFS. This means that when syncthing stays running on some workstation, I can’t launch it on any other workstation.

Maybe you can launch it via systemd somehow. I hear systemd likes killing things on logout.

1 Like

A systemd user service should do this. There’s an article on how to set it up in the docs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.