From c47be7b41547da0d6f50a0bb06ec9ef0cf16f35a Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 19 Nov 2014 16:42:05 +0800 Subject: [PATCH] systemd units for system/user --- etc/systemd/system/syncthing@.service | 14 ++++++++++++++ etc/systemd/user/syncthing.service | 12 ++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 etc/systemd/system/syncthing@.service create mode 100644 etc/systemd/user/syncthing.service 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