Configuring systemd to start Syncthing

I installed Syncthing and had it happily syncing files while running it from the command line and connecting with a browser. I now want to have it start automatically with a specific user and tried the instruction set here: https://docs.syncthing.net/users/autostart.html.

I have tried setting it up as a system service and after entering systemctl enable syncthing@www-data.service systemctl start syncthing@www-data.service

I then run systemctl status syncthing@www-data.service and that shows that it isn’t running as shown below. What am I doing wrong?

● syncthing@www-data.service - Syncthing - Open Source Continuous File Synchronization for www/data Loaded: loaded (/etc/systemd/system/syncthing@.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2019-02-16 20:30:34 EST; 21s ago Docs: man:syncthing(1) Process: 605 ExecStart=/usr/local/bin/syncthing -no-browser -no-restart -logflags=0 (code=exited, status=1/FAILURE) Main PID: 605 (code=exited, status=1/FAILURE)

Feb 16 20:30:33 pbx1 systemd[1]: syncthing@www-data.service: Unit entered failed state. Feb 16 20:30:33 pbx1 systemd[1]: syncthing@www-data.service: Failed with result ‘exit-code’. Feb 16 20:30:34 pbx1 systemd[1]: syncthing@www-data.service: Service hold-off time over, scheduling restart. Feb 16 20:30:34 pbx1 systemd[1]: Stopped Syncthing - Open Source Continuous File Synchronization for www/data. Feb 16 20:30:34 pbx1 systemd[1]: syncthing@www-data.service: Start request repeated too quickly. Feb 16 20:30:34 pbx1 systemd[1]: Failed to start Syncthing - Open Source Continuous File Synchronization for www/data. Feb 16 20:30:34 pbx1 systemd[1]: syncthing@www-data.service: Unit entered failed state. Feb 16 20:30:34 pbx1 systemd[1]: syncthing@www-data.service: Failed with result ‘exit-code’.

There are just systemd specific log lines, nothing about why Syncthing failed. You can get the full log relating to Syncthing with journalctl -r -u syncthing@www-data.

I found the problem - it was a permissions issue. All good

1 Like

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