diff --git a/etc/systemd/system/syncthing@.service b/etc/systemd/system/syncthing@.service new file mode 100644 index 000000000..f0b6b7773 --- /dev/null +++ b/etc/systemd/system/syncthing@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Syncthing service for %i +After=network.target + +[Service] +User=%i +Environment=STARGS= +EnvironmentFile=-/etc/default/syncthing +Environment=STNORESTART=yes +ExecStart=/usr/bin/syncthing ${STARGS} +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/etc/systemd/user/syncthing.service b/etc/systemd/user/syncthing.service new file mode 100644 index 000000000..22f96efab --- /dev/null +++ b/etc/systemd/user/syncthing.service @@ -0,0 +1,12 @@ +[Unit] +Description=Syncthing service + +[Service] +Environment=STARGS= +EnvironmentFile=-%h/.config/syncthing/environment +Environment=STNORESTART=yes +ExecStart=/usr/bin/syncthing ${STARGS} +Restart=always + +[Install] +WantedBy=cmdline.target