Fail to start SystemD Service

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.

I think it’s fairly trivial to understand if you read the message?

Failed at step USER spawning /usr/bin/syncthing: No such process

I have no idea what systemd is even trying to say.

1 Like

I understand what it says, but it doesn’t make sense. It’s not telling me anything to help resolve why it is failing to start. Where can I find more information find out why it isn’t starting correctly?

I decided to focus my research on the ‘Failed to determine user credentials’ and came upon [ THIS ], though related to PostGreSQL, discusses the same issue. It suggested systemctl daemon-reexec, hey presto, it works.

1 Like

You need to specify a user that actually exists.

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