summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Wegener <swegener@gentoo.org>2020-03-11 14:26:18 +0100
committerSven Wegener <swegener@gentoo.org>2020-03-11 14:43:39 +0100
commit393659df4d7ee528efa246d674038918e551d3e4 (patch)
tree65b3cc25fb2c43cd0c877d80aab659b4be2267e5 /net-dns/pdns-recursor/files/pdns-recursor-r2
parentdev-python/importlib_resources: bump to 1.3.1, introduces new deps (diff)
downloadgentoo-393659df4d7ee528efa246d674038918e551d3e4.tar.gz
gentoo-393659df4d7ee528efa246d674038918e551d3e4.tar.bz2
gentoo-393659df4d7ee528efa246d674038918e551d3e4.zip
net-dns/pdns-recursor: Revision bump for new acct packages
This also uses the new users for dropping privileges. Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Sven Wegener <swegener@gentoo.org>
Diffstat (limited to 'net-dns/pdns-recursor/files/pdns-recursor-r2')
-rw-r--r--net-dns/pdns-recursor/files/pdns-recursor-r241
1 files changed, 41 insertions, 0 deletions
diff --git a/net-dns/pdns-recursor/files/pdns-recursor-r2 b/net-dns/pdns-recursor/files/pdns-recursor-r2
new file mode 100644
index 00000000000..01ce79167bb
--- /dev/null
+++ b/net-dns/pdns-recursor/files/pdns-recursor-r2
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+PDNS_CONFIGDIR="${PDNS_CONFIGDIR:-/etc/powerdns}"
+
+PDNS_CONFIG="${PDNS_CONFIGDIR}/recursor.conf"
+PDNS_CHROOTDIR="$( awk -F = '$1 == "chroot" { print $2 }' "${PDNS_CONFIG}" )"
+PDNS_SOCKETDIR="$( awk -F = '$1 == "socket-dir" { print $2 }' "${PDNS_CONFIG}" )"
+[ -z "${PDNS_SOCKETDIR}" -a -z "${PDNS_CHROOTDIR}" ] && PDNS_SOCKETDIR="/var/run/pdns-recursor"
+
+name="PowerDNS Recursor"
+description="Recursive name server"
+
+extra_started_commands="ping"
+description_ping="Ping the PowerDNS instance"
+
+command="/usr/sbin/pdns_recursor"
+command_args="--config-dir=${PDNS_CONFIGDIR} --write-pid=yes"
+command_args_foreground="--daemon=no"
+command_args_background="--daemon=yes"
+yesno ${rc_verbose} || command_args_background="${command_args_background} >/dev/null 2>&1"
+
+pidfile="${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}/pdns_recursor.pid"
+
+control_command="/usr/bin/rec_control"
+control_command_args="${command_args}"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath --directory --mode 750 "${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}"
+}
+
+ping() {
+ ebegin "Pinging ${name}"
+ ${control_command} ${control_command_args} ping >/dev/null 2>&1
+ eend $?
+}