From: Guus Sliepen Date: Sat, 6 Jan 2018 15:17:35 +0000 (+0100) Subject: Remove hardcoded paths from systemd unit files. X-Git-Tag: release-1.1pre16~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c550c85d75ae38b9621147fdca4bf4380d54edda;p=oweals%2Ftinc.git Remove hardcoded paths from systemd unit files. Closes #160 on GitHub. --- diff --git a/systemd/Makefile.am b/systemd/Makefile.am index a1bfe12..b350847 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -1,4 +1,18 @@ +EXTRA_DIST = tinc.service.in tinc@.service.in + +CLEANFILES = tinc.service tinc@.service + if WITH_SYSTEMD systemddir = @systemd_path@ dist_systemd_DATA = tinc.service tinc@.service endif + +substitute = sed \ + -e s,'@sbindir\@',"$(sbindir)",g \ + -e s,'@sysconfdir\@',"$(sysconfdir)",g + +tinc.service: $(srcdir)/tinc.service.in + $(AM_V_GEN)$(substitute) $(srcdir)/tinc.service.in > $@ + +tinc@.service: $(srcdir)/tinc@.service.in + $(AM_V_GEN)$(substitute) $(srcdir)/tinc@.service.in > $@ diff --git a/systemd/tinc.service b/systemd/tinc.service deleted file mode 100644 index d911fa7..0000000 --- a/systemd/tinc.service +++ /dev/null @@ -1,20 +0,0 @@ -# This is a mostly empty service, but allows commands like stop, start, reload -# to propagate to all tinc@ service instances. - -[Unit] -Description=Tinc VPN -Documentation=info:tinc -Documentation=man:tinc(8) man:tinc.conf(5) -Documentation=http://tinc-vpn.org/docs/ -After=network.target -Wants=network.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/true -ExecReload=/bin/true -WorkingDirectory=/etc/tinc - -[Install] -WantedBy=multi-user.target diff --git a/systemd/tinc.service.in b/systemd/tinc.service.in new file mode 100644 index 0000000..b671042 --- /dev/null +++ b/systemd/tinc.service.in @@ -0,0 +1,20 @@ +# This is a mostly empty service, but allows commands like stop, start, reload +# to propagate to all tinc@ service instances. + +[Unit] +Description=Tinc VPN +Documentation=info:tinc +Documentation=man:tinc(8) man:tinc.conf(5) +Documentation=http://tinc-vpn.org/docs/ +After=network.target +Wants=network.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/true +ExecReload=/bin/true +WorkingDirectory=@sysconfdir@/tinc + +[Install] +WantedBy=multi-user.target diff --git a/systemd/tinc@.service b/systemd/tinc@.service deleted file mode 100644 index d1f711d..0000000 --- a/systemd/tinc@.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Tinc net %i -Documentation=info:tinc -Documentation=man:tinc(8) man:tinc.conf(5) -Documentation=http://tinc-vpn.org/docs/ -PartOf=tinc.service -ReloadPropagatedFrom=tinc.service - -[Service] -Type=simple -WorkingDirectory=/etc/tinc/%i -ExecStart=/usr/sbin/tincd -n %i -D -ExecReload=/usr/sbin/tinc -n %i reload -KillMode=mixed -Restart=on-failure -RestartSec=5 -TimeoutStopSec=5 - -[Install] -WantedBy=tinc.service diff --git a/systemd/tinc@.service.in b/systemd/tinc@.service.in new file mode 100644 index 0000000..2d695ca --- /dev/null +++ b/systemd/tinc@.service.in @@ -0,0 +1,20 @@ +[Unit] +Description=Tinc net %i +Documentation=info:tinc +Documentation=man:tinc(8) man:tinc.conf(5) +Documentation=http://tinc-vpn.org/docs/ +PartOf=tinc.service +ReloadPropagatedFrom=tinc.service + +[Service] +Type=simple +WorkingDirectory=@sysconfdir@/tinc/%i +ExecStart=@sbindir@/tincd -n %i -D +ExecReload=@sbindir@/tinc -n %i reload +KillMode=mixed +Restart=on-failure +RestartSec=5 +TimeoutStopSec=5 + +[Install] +WantedBy=tinc.service