]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
pdns-recursor: Apply default configuration and update systemd files.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Aug 2011 21:17:04 +0000 (23:17 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Aug 2011 21:17:04 +0000 (23:17 +0200)
Squashed commit of the following:

commit 281610665b623f932c9f23a064885d82b4778d3b
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Sun Aug 7 23:13:19 2011 +0200

    pdns-recursor: Fix typo.

commit dab23e897531056d9d4d33d166dc00ddb371247a
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Sun Aug 7 22:53:20 2011 +0200

    pdns-recursor: Remove shipped config file.

commit 800b254840611026c690d8502afa51a0e682819c
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Sun Aug 7 22:42:50 2011 +0200

    pdns-recursor: Improve systemd service file.

commit d71560c7083d02bdbc9d0ac94235936e20f5fa07
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Sun Aug 7 22:33:22 2011 +0200

    pdns-recursor: Add tmpfile for systemd.

commit f5e7003455eb455780c6638a661201c35efb3ea7
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Sun Aug 7 22:30:15 2011 +0200

    pdns-recursor: Add default config.

commit 882aa37ccdc0bca6d0a1ef39b9629e8c54acbbff
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date:   Sun Aug 7 21:57:53 2011 +0200

    pdns-recursor: Always restart service.

pkgs/pdns-recursor/pdns-recursor.nm
pkgs/pdns-recursor/pdns-recursor.tmpfiles [new file with mode: 0644]
pkgs/pdns-recursor/recursor.conf [new file with mode: 0644]
pkgs/pdns-recursor/systemd/pdns-recursor.service

index 9e4a995552444336ab8d8320b93f17dc68622c4d..05a85cc0f9952eac60e619fd6b7cbb10d5b361a9 100644 (file)
@@ -26,7 +26,7 @@ include $(PKGROOT)/Include
 
 PKG_NAME       = pdns-recursor
 PKG_VER        = 3.3
-PKG_REL        = 2
+PKG_REL        = 3
 
 PKG_MAINTAINER =
 PKG_GROUPS     = Networking/DNS
@@ -56,7 +56,18 @@ define STAGE_INSTALL
        cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT) \
                CONFIGDIR=/etc/$(PKG_NAME)
 
+       # Remove sysvinit file
        rm -rf $(BUILDROOT)/etc/init.d
 
-       mv -v $(BUILDROOT)/etc/$(PKG_NAME)/recursor.conf{-dist,}
+       # Remove shipped config file
+       rm -rf $(BUILDROOT)/etc/$(PKG_NAME)/recursor.conf-dist
+
+       # Install our default config file
+       cp -vf $(DIR_SOURCE)/recursor.conf $(BUILDROOT)/etc/$(PKG_NAME)/recursor.conf
+
+       # Create folder for chroot
+       -mkdir -pv $(BUILDROOT)/var/lib/pdns-recursor
 endef
+
+# XXX Need to create user and group "pdns-recursor" at installation
+# useradd -r -g pdns-recursor pdns-recursor -d /var/lib/pdns-recursor -s /sbin/nologin
diff --git a/pkgs/pdns-recursor/pdns-recursor.tmpfiles b/pkgs/pdns-recursor/pdns-recursor.tmpfiles
new file mode 100644 (file)
index 0000000..2fbee00
--- /dev/null
@@ -0,0 +1 @@
+d /run/pdns-recursor 0755 pdns-recursor pdns-recursor -
diff --git a/pkgs/pdns-recursor/recursor.conf b/pkgs/pdns-recursor/recursor.conf
new file mode 100644 (file)
index 0000000..7ecc30b
--- /dev/null
@@ -0,0 +1,13 @@
+
+# XXX IPv6 listen on :: cannot be created. Says Address is already in use.
+local-address=0.0.0.0 ::1
+
+socket-dir=/run/pdns-recursor
+socket-group=pdns-recursor
+socket-owner=pdns-recursor
+socket-mode=660
+
+# Security settings
+chroot=/var/lib/pdns-recursor
+setgid=pdns-recursor
+setuid=pdns-recursor
index b30521eb297aa57e514fb08780cecd3e3138ff2b..f0aa1abce1d292598cdf20b6e87bd109a7389190 100644 (file)
@@ -4,6 +4,9 @@ After=network.target
 
 [Service]
 ExecStart=/usr/sbin/pdns_recursor --daemon=no
+ExecStopPost=/bin/rm -f /run/pdns-recursor/pdns_recursor.pid
+ExecStopPost=/bin/rm -f /run/pdns-recursor/pdns_recursor.controlsocket
+Restart=always
 
 [Install]
 WantedBy=multi-user.target