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.initd36
1 files changed, 19 insertions, 17 deletions
diff --git a/testing/unbound/unbound.initd b/testing/unbound/unbound.initd
index 08944b60ef..90deb23e4a 100644
--- a/testing/unbound/unbound.initd
+++ b/testing/unbound/unbound.initd
@@ -1,13 +1,18 @@
#!/sbin/runscript
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/unbound/files/unbound.initd,v 1.1 2009/11/22 16:57:33 matsuu Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/unbound/files/unbound.initd,v 1.2 2011/09/13 15:14:49 matsuu Exp $
+
+name="unbound daemon"
+extra_commands="configtest"
+extra_started_commands="reload"
+description="unbound is a Domain Name Server (DNS) that is used to resolve host names to IP address."
+description_configtest="Run syntax tests for configuration files only."
+description_reload="Kills all children and reloads the configuration."
-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() {
@@ -19,14 +24,18 @@ depend() {
checkconfig() {
UNBOUND_PIDFILE=$("${UNBOUND_CHECKCONF}" -o pidfile "${UNBOUND_CONFFILE}")
- UNBOUND_USER=$("${UNBOUND_CHECKCONF}" -o username "${UNBOUND_CONFFILE}")
return $?
}
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
start() {
checkconfig || return $?
- ebegin "Starting unbound"
- su -c "${UNBOUND_ANCHOR}" -s /bin/sh ${UNBOUND_USER}
+ ebegin "Starting ${SVCNAME}"
start-stop-daemon --start --pidfile "${UNBOUND_PIDFILE}" \
--exec "${UNBOUND_BINARY}" -- -c "${UNBOUND_CONFFILE}"
eend $?
@@ -34,21 +43,14 @@ start() {
stop() {
checkconfig || return $?
- ebegin "Stopping unbound"
+ ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}"
eend $?
}
-restart() {
- checkconfig || return $?
- svc_stop
- svc_start
-}
-
reload() {
checkconfig || return $?
- ebegin "Reloading unbound"
- start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}" \
- --signal HUP --oknodo
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${UNBOUND_PIDFILE}"
eend $?
}