Starting syncthing from Systemd (take 2)

To sum up:

  • The user instance stuff with --user is intended to be used on a desktop computer. Syncthing starts when you log in to gnome or something; and it stops when you log out.
  • The system instance stuff is useful for a server. Syncthing then starts during the normal bootup sequence and stays running. To be able to specify the user, there is the templating stuff with @, e.g.: systemctl start syncthing@hans.service.
  • The user units are located in /usr/lib/systemd/user/ and can be overwritten in /etc/systemd/user/ and ~/.config/systemd/user/.
  • The system units are located in /usr/lib/systemd/system/ and can be overwritten in /etc/systemd/system/.

So, when you mix them up by accident, strange things happen.

Note: The paths are valid for arch linux and fedora and are documented in the systemd manpages. Debian (as usual) does its own thing.

1 Like