Can't launch syncthing as a systemd service

I don’t find any solution to this problem.

For information : syncthing v1.3.2 “Fermium Flea” (go1.13.4 linux-386) teamcity@build.syncthing.net 2019-11-24 08:33:58 UTC

“marc” is an actual user on a debian with no sudo rights. marc can launch syncthing as a user through a terminal.

Here is my service file : syncthing@marc.service :

[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target

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

# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

When starting it with “sudo systemctl start syncthing@marc.service”, i get the following logs from systemd :

déc. 09 21:55:41 syncdz systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for marc.
déc. 09 21:55:41 syncdz systemd[1]: syncthing@marc.service: Main process exited, code=killed, status=31/SYS
déc. 09 21:55:41 syncdz systemd[1]: syncthing@marc.service: Failed with result 'signal'.
déc. 09 21:55:41 syncdz systemd[1]: syncthing@marc.service: Service RestartSec=100ms expired, scheduling restart.
déc. 09 21:55:41 syncdz systemd[1]: syncthing@marc.service: Scheduled restart job, restart counter is at 1.
déc. 09 21:55:41 syncdz systemd[1]: Stopped Syncthing - Open Source Continuous File Synchronization for marc.

and from systemctl status :

cedric@syncdz:~$ sudo systemctl status syncthing@marc.service
● syncthing@marc.service - Syncthing - Open Source Continuous File Synchronization for marc
Loaded: loaded (/etc/systemd/system/syncthing@marc.service; disabled; vendor preset: enabled)
Active: failed (Result: signal) since Mon 2019-12-09 22:26:16 CET; 13s ago
Docs: man:syncthing(1)
Process: 1259 ExecStart=/usr/local/bin/syncthing -no-browser -no-restart -logflags=0 (code=killed, signal=SYS)
Main PID: 1259 (code=killed, signal=SYS)

I’ve seen issues with the hardening options on old systems with old systemd. You might try removing some. Is this a 32 bit system? Otherwise the 64 bit version will be superior.

it’s a fairly old 32bit system… intel D510… but with a newly installed debian. Gonna check that.

I removed them all and it actually worked. Thank you.

I will now try to put theses options back some one by one and see what happens.

1 Like

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