systemd issues on CentOS 7

Running on a fresh CentOS 7 box.

Syncthing is located in /usr/local/bin/syncthing and runs fine manually from the command line.

I’m attempting to run Syncthing as a system service.

Following the instructions here: https://docs.syncthing.net/users/autostart.html#linux

Here’s my ouput:

[root@server bin]# cp syncthing/etc/linux-systemd/system/syncthing@.service /usr/lib/systemd/system

[root@server bin]# systemctl enable syncthing@syncthing.service
Created symlink from /etc/systemd/system/multi-user.target.wants/syncthing@syncthing.service to /usr/lib/systemd/system/syncthing@.service.

[root@server bin]# systemctl start syncthing@syncthing.service

[root@server bin]# systemctl status syncthing@syncthing.service -l
● syncthing@syncthing.service - Syncthing - Open Source Continuous File Synchronization for syncthing
   Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2017-04-20 06:17:03 PDT; 8s ago
     Docs: man:syncthing(1)
  Process: 30813 ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 (code=exited, status=203/EXEC)
 Main PID: 30813 (code=exited, status=203/EXEC)

Apr 20 06:17:03 server.example.com systemd[1]: Unit syncthing@syncthing.service entered failed state.
Apr 20 06:17:03 server.example.com systemd[1]: syncthing@syncthing.service failed.
Apr 20 06:17:03 server.example.com systemd[1]: syncthing@syncthing.service holdoff time over, scheduling restart.
Apr 20 06:17:03 server.example.com systemd[1]: start request repeated too quickly for syncthing@syncthing.service
Apr 20 06:17:03 server.example.com systemd[1]: Failed to start Syncthing - Open Source Continuous File Synchronization for syncthing.
Apr 20 06:17:03 server.example.com systemd[1]: Unit syncthing@syncthing.service entered failed state.
Apr 20 06:17:03 server.example.com systemd[1]: syncthing@syncthing.service failed.

Ideas? Thanks in advance.

See what the logs says - journalctl -r -u syncthing@syncthing.service

Logs showed that it couldn’t find syncthing (was looking in /usr/bin/syncthing and I had it in /usr/local/bin/syncthing) so I moved it to /usr/bin/syncthing.

Was seeing permissions issues, so did a chown -R syncthing:root /usr/bin/syncthing.

(I had previously added the syncthing user)

Still seeing this as the journalctl output:

-- Logs begin at Tue 2017-04-18 16:48:03 PDT, end at Thu 2017-04-20 07:06:34 PDT. --
Apr 20 07:06:34 server.example.com systemd[1]: syncthing@syncthing.service failed.
Apr 20 07:06:34 server.example.com systemd[1]: Unit syncthing@syncthing.service entered failed state.
Apr 20 07:06:34 server.example.com systemd[1]: Failed to start Syncthing - Open Source Continuous File Synchronization for syncthin
Apr 20 07:06:34 server.example.com systemd[1]: start request repeated too quickly for syncthing@syncthing.service
Apr 20 07:06:34 server.example.com systemd[1]: syncthing@syncthing.service holdoff time over, scheduling restart.
Apr 20 07:06:34 server.example.com systemd[1]: syncthing@syncthing.service failed.
Apr 20 07:06:34 server.example.com systemd[1]: Unit syncthing@syncthing.service entered failed state.
Apr 20 07:06:34 server.example.com systemd[1]: syncthing@syncthing.service: main process exited, code=exited, status=203/EXEC
Apr 20 07:06:34 server.example.com systemd[32403]: Failed at step EXEC spawning /usr/bin/syncthing: Permission denied

DERP

Gotit.

I had the syncthing DIRECTORY that had expanded from the tar file in /usr/bin (and previously /usr/local/bin).

I realized I needed the actual binary file that had previously been /usr/bin/syncthing/syncthing to just be /usr/bin/syncthing.

Thanks for the reply and nudging me where to look. :slight_smile:

1 Like

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