I’ve done this for four other machines, but for some reason, it fails on this one. SystemD Files: sudo nano syncthing@.service
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
[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
sudo nano syncthing-resume.service
[Unit]
Description=Restart Syncthing after resume
Documentation=man:syncthing(1)
After=sleep.target
[Service]
Type=oneshot
ExecStart=-/usr/bin/pkill -HUP -x syncthing
[Install]
WantedBy=sleep.target
systemctl enable syncthing@myuser.service
systemctl start syncthing@myuser.service
…but I get:
Aug 28 23:41:55 server systemd[1]: Stopped Syncthing - Open Source Continuous File Synchronization for myuser.
Aug 28 23:41:55 server systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for myuser.
Aug 28 23:41:55 server systemd[12450]: syncthing@myuser.service: Failed to determine user credentials: No such process
Aug 28 23:41:55 server systemd[12450]: syncthing@myuser.service: Failed at step USER spawning /usr/bin/syncthing: No such process
Aug 28 23:41:55 server systemd[1]: syncthing@myuser.service: Main process exited, code=exited, status=217/USER
Aug 28 23:41:55 server systemd[1]: syncthing@myuser.service: Failed with result 'exit-code'.
Aug 28 23:41:55 server systemd[1]: syncthing@myuser.service: Service RestartSec=100ms expired, scheduling restart.
Aug 28 23:41:55 server systemd[1]: syncthing@myuser.service: Scheduled restart job, restart counter is at 5.
Aug 28 23:41:55 server systemd[1]: Stopped Syncthing - Open Source Continuous File Synchronization for myuser.
Aug 28 23:41:55 server systemd[1]: syncthing@myuser.service: Start request repeated too quickly.
Aug 28 23:41:55 server systemd[1]: syncthing@myuser.service: Failed with result 'exit-code'.
Aug 28 23:41:55 server systemd[1]: Failed to start Syncthing - Open Source Continuous File Synchronization for myuser.