mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 18:41:59 -07:00
Merge pr/988
* commit 'b9817ac': add README on-failure instead of always as we cannot otherwise kill the service systemd units for system/user
This commit is contained in:
commit
854d720ce0
27
etc/linux-systemd/README.md
Normal file
27
etc/linux-systemd/README.md
Normal file
@ -0,0 +1,27 @@
|
||||
This directory contains a configuration for running syncthing under the
|
||||
"systemd" service manager on Linux both under either a systemd system service or
|
||||
systemd user service.
|
||||
|
||||
1. Install systemd.
|
||||
|
||||
2. If you are running this as a system level service:
|
||||
|
||||
1. Create the user you will be running the service as (foo in this example).
|
||||
|
||||
2. Copy the syncthing@.service files to /etc/systemd/system
|
||||
|
||||
3. Enable and start the service
|
||||
systemctl enable syncthing@foo.service
|
||||
systemctl start syncthing@foo.service
|
||||
|
||||
3. If you are running this as a user level service:
|
||||
|
||||
1. Log in as the user you will be running the service as
|
||||
|
||||
2. Copy the syncthing.service files to /etc/systemd/user
|
||||
|
||||
3. Enable and start the service
|
||||
systemctl --user enable syncthing.service
|
||||
systemctl --user start syncthing.service
|
||||
|
||||
Log output is sent to the journal.
|
14
etc/linux-systemd/system/syncthing@.service
Normal file
14
etc/linux-systemd/system/syncthing@.service
Normal file
@ -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=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
12
etc/linux-systemd/user/syncthing.service
Normal file
12
etc/linux-systemd/user/syncthing.service
Normal file
@ -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=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=cmdline.target
|
Loading…
Reference in New Issue
Block a user