+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 > $@
[Service]
Type=simple
-WorkingDirectory=/etc/tinc/%i
-ExecStart=/usr/sbin/tincd -n %i -D
-ExecReload=/usr/sbin/tinc -n %i reload
+WorkingDirectory=@sysconfdir@/tinc/%i
+ExecStart=@sbindir@/tincd -n %i -D
+ExecReload=@sbindir@/tinc -n %i reload
KillMode=mixed
Restart=on-failure
RestartSec=5