mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
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>
This commit is contained in:
41
net-dns/pdns-recursor/files/pdns-recursor-r2
Normal file
41
net-dns/pdns-recursor/files/pdns-recursor-r2
Normal file
@@ -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 $?
|
||||
}
|
||||
@@ -27,7 +27,9 @@ DEPEND="!luajit? ( >=dev-lang/lua-5.1:= )
|
||||
!libressl? ( dev-libs/openssl:= )
|
||||
>=dev-libs/boost-1.35:="
|
||||
RDEPEND="${DEPEND}
|
||||
!<net-dns/pdns-2.9.20-r1"
|
||||
!<net-dns/pdns-2.9.20-r1
|
||||
acct-user/pdns
|
||||
acct-group/pdns"
|
||||
BDEPEND="virtual/pkgconfig"
|
||||
|
||||
S="${WORKDIR}"/${P/_/-}
|
||||
@@ -54,14 +56,12 @@ src_install() {
|
||||
|
||||
# set defaults: setuid=nobody, setgid=nobody
|
||||
sed -i \
|
||||
-e 's/^# set\([ug]\)id=$/set\1id=nobody/' \
|
||||
-e 's/^# set\([ug]\)id=$/set\1id=pdns/' \
|
||||
-e 's/^# quiet=$/quiet=on/' \
|
||||
-e 's/^# chroot=$/chroot=\/var\/lib\/powerdns/' \
|
||||
"${D}"/etc/powerdns/recursor.conf
|
||||
|
||||
newinitd "${FILESDIR}"/pdns-recursor-r1 pdns-recursor
|
||||
|
||||
keepdir /var/lib/powerdns
|
||||
newinitd "${FILESDIR}"/pdns-recursor-r2 pdns-recursor
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
Reference in New Issue
Block a user