From 5e2e33be7699b954f850aeb37719b03f5b502978 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Sun, 17 Mar 2024 13:16:30 +0000 Subject: [PATCH] Add systemd service for Syncthing --- .config/systemd/user/syncthing.service | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .config/systemd/user/syncthing.service diff --git a/.config/systemd/user/syncthing.service b/.config/systemd/user/syncthing.service new file mode 100644 index 0000000..18078d0 --- /dev/null +++ b/.config/systemd/user/syncthing.service @@ -0,0 +1,24 @@ +[Unit] +Description=Syncthing - Open Source Continuous File Synchronization +Documentation=man:syncthing(1) +StartLimitIntervalSec=60 +StartLimitBurst=4 + +[Service] +ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0 +Restart=on-failure +RestartSec=1 +SuccessExitStatus=3 4 +RestartForceExitStatus=3 4 + +# Hardening +SystemCallArchitectures=native +MemoryDenyWriteExecute=true +NoNewPrivileges=true + +# Elevated permissions to sync ownership (disabled by default), +# see https://docs.syncthing.net/advanced/folder-sync-ownership +#AmbientCapabilities=CAP_CHOWN CAP_FOWNER + +[Install] +WantedBy=default.target