Gentoo Archives: gentoo-commits

From: Sven Wegener <swegener@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns-recursor/, net-dns/pdns-recursor/files/
Date: Wed, 11 Mar 2020 13:43:46
Message-Id: 1583934219.393659df4d7ee528efa246d674038918e551d3e4.swegener@gentoo
1 commit: 393659df4d7ee528efa246d674038918e551d3e4
2 Author: Sven Wegener <swegener <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 11 13:26:18 2020 +0000
4 Commit: Sven Wegener <swegener <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 11 13:43:39 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=393659df
7
8 net-dns/pdns-recursor: Revision bump for new acct packages
9
10 This also uses the new users for dropping privileges.
11
12 Package-Manager: Portage-2.3.89, Repoman-2.3.20
13 Signed-off-by: Sven Wegener <swegener <AT> gentoo.org>
14
15 net-dns/pdns-recursor/files/pdns-recursor-r2 | 41 ++++++++++++++++++++++
16 ...-4.3.0.ebuild => pdns-recursor-4.3.0-r1.ebuild} | 10 +++---
17 2 files changed, 46 insertions(+), 5 deletions(-)
18
19 diff --git a/net-dns/pdns-recursor/files/pdns-recursor-r2 b/net-dns/pdns-recursor/files/pdns-recursor-r2
20 new file mode 100644
21 index 00000000000..01ce79167bb
22 --- /dev/null
23 +++ b/net-dns/pdns-recursor/files/pdns-recursor-r2
24 @@ -0,0 +1,41 @@
25 +#!/sbin/openrc-run
26 +# Copyright 1999-2020 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +PDNS_CONFIGDIR="${PDNS_CONFIGDIR:-/etc/powerdns}"
30 +
31 +PDNS_CONFIG="${PDNS_CONFIGDIR}/recursor.conf"
32 +PDNS_CHROOTDIR="$( awk -F = '$1 == "chroot" { print $2 }' "${PDNS_CONFIG}" )"
33 +PDNS_SOCKETDIR="$( awk -F = '$1 == "socket-dir" { print $2 }' "${PDNS_CONFIG}" )"
34 +[ -z "${PDNS_SOCKETDIR}" -a -z "${PDNS_CHROOTDIR}" ] && PDNS_SOCKETDIR="/var/run/pdns-recursor"
35 +
36 +name="PowerDNS Recursor"
37 +description="Recursive name server"
38 +
39 +extra_started_commands="ping"
40 +description_ping="Ping the PowerDNS instance"
41 +
42 +command="/usr/sbin/pdns_recursor"
43 +command_args="--config-dir=${PDNS_CONFIGDIR} --write-pid=yes"
44 +command_args_foreground="--daemon=no"
45 +command_args_background="--daemon=yes"
46 +yesno ${rc_verbose} || command_args_background="${command_args_background} >/dev/null 2>&1"
47 +
48 +pidfile="${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}/pdns_recursor.pid"
49 +
50 +control_command="/usr/bin/rec_control"
51 +control_command_args="${command_args}"
52 +
53 +depend() {
54 + need net
55 +}
56 +
57 +start_pre() {
58 + checkpath --directory --mode 750 "${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}"
59 +}
60 +
61 +ping() {
62 + ebegin "Pinging ${name}"
63 + ${control_command} ${control_command_args} ping >/dev/null 2>&1
64 + eend $?
65 +}
66
67 diff --git a/net-dns/pdns-recursor/pdns-recursor-4.3.0.ebuild b/net-dns/pdns-recursor/pdns-recursor-4.3.0-r1.ebuild
68 similarity index 91%
69 rename from net-dns/pdns-recursor/pdns-recursor-4.3.0.ebuild
70 rename to net-dns/pdns-recursor/pdns-recursor-4.3.0-r1.ebuild
71 index d3ed153e567..fa5437a3d38 100644
72 --- a/net-dns/pdns-recursor/pdns-recursor-4.3.0.ebuild
73 +++ b/net-dns/pdns-recursor/pdns-recursor-4.3.0-r1.ebuild
74 @@ -27,7 +27,9 @@ DEPEND="!luajit? ( >=dev-lang/lua-5.1:= )
75 !libressl? ( dev-libs/openssl:= )
76 >=dev-libs/boost-1.35:="
77 RDEPEND="${DEPEND}
78 - !<net-dns/pdns-2.9.20-r1"
79 + !<net-dns/pdns-2.9.20-r1
80 + acct-user/pdns
81 + acct-group/pdns"
82 BDEPEND="virtual/pkgconfig"
83
84 S="${WORKDIR}"/${P/_/-}
85 @@ -54,14 +56,12 @@ src_install() {
86
87 # set defaults: setuid=nobody, setgid=nobody
88 sed -i \
89 - -e 's/^# set\([ug]\)id=$/set\1id=nobody/' \
90 + -e 's/^# set\([ug]\)id=$/set\1id=pdns/' \
91 -e 's/^# quiet=$/quiet=on/' \
92 -e 's/^# chroot=$/chroot=\/var\/lib\/powerdns/' \
93 "${D}"/etc/powerdns/recursor.conf
94
95 - newinitd "${FILESDIR}"/pdns-recursor-r1 pdns-recursor
96 -
97 - keepdir /var/lib/powerdns
98 + newinitd "${FILESDIR}"/pdns-recursor-r2 pdns-recursor
99 }
100
101 pkg_postinst() {