1

I'd like to run syncthing as a daemon, trying to follow this hint here from the syncthing manual.

I'm running on Fedora 25 and syncthing 0.14.24.

The executable is pointed to via a symlink in /usr/bin/syncthing which can be executed by any user (tested this successfully).

To enable the service, I'm typing (myuser is replaced with my actual username in all of the below):

sudo systemctl enable sycnthing@myuser.service

Which returns:

Failed to lookup unit file state: Invalid argument

I don't understand what the error message means. How could I get to run syncthing as a daemon?


syncthing@myuser.service:

[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
Wants=syncthing-inotify@myuser.service  # I also commented this line out; didn't have an effect

[Service]
User=%i
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
Restart=on-failure
SuccessExitStatus=3 4
RestartForceExitStatus=3 4

[Install]
WantedBy=multi-user.target
HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
pandita
  • 4,739
  • 6
  • 29
  • 51

1 Answers1

0

I think myuser should be substituted for your actual username.

Arch wiki has a pretty good article:

System service

Running Syncthing as a system service ensures that it is running at startup even if the user has no active session, it is intended to be used on a server.

Enable and start the syncthing@myuser.service where myuser is the actual name of your user.

Credit: https://wiki.archlinux.org/index.php/Syncthing

Community
  • 1
  • 1
Dean
  • 1
  • 4
  • Sorry, should have made clear that 'myuser' in the code above is a placeholder for my actual username. Will edit the question. Thanks for the link, will have a look. – pandita Mar 19 '17 at 07:00
  • Ok cool i Just thought i would check. Tried copying the ExecStart line and see if that works on its own? – Dean Mar 19 '17 at 07:09
  • Sorry not sure i can help... can try: SYSTEMD_LOG_LEVEL=debug sudo journalctl -u syncthing ? Good luck! – Dean Mar 19 '17 at 07:23
  • Hi again, when I looked through the documentation in the [Fedora wiki](https://fedoraproject.org/wiki/How_to_debug_Systemd_problems) this is described as something I can set as a boot parameter. Can I somehow set this on the running pc as well? Cheers! – pandita Mar 25 '17 at 03:59