From: Pieter Lexis Date: Wed, 1 Jun 2016 13:34:05 +0000 (+0200) Subject: recursor: Add multi-instance unit-file X-Git-Tag: rec-4.0.0-rc1~10^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a67f98c2799b02632ff8732fedfffe475f9db353;p=pdns recursor: Add multi-instance unit-file Closes #3922 --- diff --git a/build-scripts/build-recursor-debian b/build-scripts/build-recursor-debian index 25e4cb7c2..1e61033a5 100755 --- a/build-scripts/build-recursor-debian +++ b/build-scripts/build-recursor-debian @@ -44,7 +44,7 @@ export ID="${ID}" export VERSION_ID="${VERSION_ID}" if [ ${ID} = "ubuntu" -a ${VERSION_ID} = "14.04" ]; then - sed -i '/lib\/systemd\/system\/pdns-recursor\.service/d' debian/pdns-recursor.install + sed -i '/lib\/systemd\/system\/pdns-recursor@\?\.service/d' debian/pdns-recursor.install fi fakeroot debian/rules debian/control diff --git a/build-scripts/build-recursor-rpm b/build-scripts/build-recursor-rpm index d9907108c..4e4ac0410 100755 --- a/build-scripts/build-recursor-rpm +++ b/build-scripts/build-recursor-rpm @@ -283,6 +283,7 @@ exit 0 %{_mandir}/man1/pdns_recursor.1.gz %{_mandir}/man1/rec_control.1.gz %{_unitdir}/pdns-recursor.service +%{_unitdir}/pdns-recursor@.service %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/recursor.conf %doc COPYING README diff --git a/build-scripts/debian-recursor/pdns-recursor.install b/build-scripts/debian-recursor/pdns-recursor.install index f43716fb9..e202ebb4d 100644 --- a/build-scripts/debian-recursor/pdns-recursor.install +++ b/build-scripts/debian-recursor/pdns-recursor.install @@ -1,3 +1,4 @@ debian/tmp/usr/sbin/pdns_recursor usr/sbin/ debian/tmp/usr/bin/rec_control usr/bin/ lib/systemd/system/pdns-recursor.service lib/systemd/system/ +lib/systemd/system/pdns-recursor@.service lib/systemd/system/ diff --git a/pdns/recursordist/.gitignore b/pdns/recursordist/.gitignore index cc7d9da8a..9d26984e8 100644 --- a/pdns/recursordist/.gitignore +++ b/pdns/recursordist/.gitignore @@ -39,3 +39,4 @@ /dnsmessage.pb.cc /dnsmessage.pb.h /pdns-recursor.service +/pdns-recursor@.service diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index 8192a3c6d..3d3dd22a4 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -239,8 +239,14 @@ if HAVE_SYSTEMD pdns-recursor.service: pdns-recursor.service.in $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' < $< > $@ +pdns-recursor@.service: pdns-recursor.service + $(AM_V_GEN)sed -e 's!/pdns_recursor!& --config-name=%i!' \ + -e 's!Recursor!& %i!' \ + < $< > $@ + systemdsystemunitdir = $(SYSTEMD_DIR) systemdsystemunit_DATA = \ - pdns-recursor.service + pdns-recursor.service \ + pdns-recursor@.service endif