Skip to content

Instantly share code, notes, and snippets.

@Finkregh
Created August 27, 2015 08:06
Show Gist options
  • Save Finkregh/4178f1588970f1530a13 to your computer and use it in GitHub Desktop.
Save Finkregh/4178f1588970f1530a13 to your computer and use it in GitHub Desktop.
systemd-service file for lsyncd
[Unit]
Description=Live Syncing (Mirror) Daemon
After=network.target
[Service]
Restart=always
Type=simple
Nice=19
#EnvironmentFile=-/etc/default/lsyncd
#ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd/lsyncd.conf.lua`'
ExecStart=/usr/bin/lsyncd -nodaemon -pidfile /run/lsyncd.pid /etc/lsyncd/lsyncd.conf.lua
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/run/lsyncd.pid
[Install]
WantedBy=multi-user.target
@dequn
Copy link

dequn commented May 8, 2018

Good, thank you.

@gregd
Copy link

gregd commented Aug 8, 2018

It seems that all pid options are not needed because of the nodaemon option. systemd should take of a process management when using "Type=simple".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment