aboutsummaryrefslogtreecommitdiffstats
path: root/testing/unbound/unbound.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/unbound/unbound.initd')
-rw-r--r--testing/unbound/unbound.initd3
1 files changed, 3 insertions, 0 deletions
diff --git a/testing/unbound/unbound.initd b/testing/unbound/unbound.initd
index e9e902c9b9..08944b60ef 100644
--- a/testing/unbound/unbound.initd
+++ b/testing/unbound/unbound.initd
@@ -7,6 +7,7 @@ opts="${opts} checkconfig reload"
UNBOUND_BINARY=${UNBOUND_BINARY:-/usr/sbin/unbound}
UNBOUND_CHECKCONF=${UNBOUND_CHECKCONF:-/usr/sbin/unbound-checkconf}
+UNBOUND_ANCHOR=${UNBOUND_ANCHOR:-/usr/sbin/unbound-anchor}
UNBOUND_CONFFILE=${UNBOUND_CONFFILE:-/etc/unbound/${SVCNAME}.conf}
depend() {
@@ -18,12 +19,14 @@ depend() {
checkconfig() {
UNBOUND_PIDFILE=$("${UNBOUND_CHECKCONF}" -o pidfile "${UNBOUND_CONFFILE}")
+ UNBOUND_USER=$("${UNBOUND_CHECKCONF}" -o username "${UNBOUND_CONFFILE}")
return $?
}
start() {
checkconfig || return $?
ebegin "Starting unbound"
+ su -c "${UNBOUND_ANCHOR}" -s /bin/sh ${UNBOUND_USER}
start-stop-daemon --start --pidfile "${UNBOUND_PIDFILE}" \
--exec "${UNBOUND_BINARY}" -- -c "${UNBOUND_CONFFILE}"
eend $?