summaryrefslogtreecommitdiff
path: root/package/bind/bind.sysvinit
diff options
context:
space:
mode:
authorDavid Anders <dave123@abcsinc.com>2006-01-25 20:56:55 +0000
committerDavid Anders <dave123@abcsinc.com>2006-01-25 20:56:55 +0000
commite507951611b730e80e405aefcfb74307e107fc8a (patch)
tree4e66cf80cb57b35035dfbb8a6a244f4971ed3ef9 /package/bind/bind.sysvinit
parent9f9e02025e1b904250d960d01ba9d441f7a4a638 (diff)
add new package bind per case 0000507
Diffstat (limited to 'package/bind/bind.sysvinit')
-rw-r--r--package/bind/bind.sysvinit52
1 files changed, 52 insertions, 0 deletions
diff --git a/package/bind/bind.sysvinit b/package/bind/bind.sysvinit
new file mode 100644
index 000000000..a9babd215
--- /dev/null
+++ b/package/bind/bind.sysvinit
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# System-V init to control the bind DNS Daemon
+#
+
+NAME=named
+DAEMON=/usr/sbin/$NAME
+
+# this file contains a few tunable parameters
+test -r /etc/default/named && . /etc/default/named
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ test -z "$CHROOT" || ARGS="$ARGS -t $CHROOT"
+ test -z "$SETUID" || ARGS="$ARGS -u $SETUID"
+ if [ ! -f $CHROOT/etc/rndc.key ]; then
+ echo -n "Initializing $NAME control key: rndc-confgen"
+ set +e
+ touch $CHROOT/etc/rndc.key # handle symlinks
+ rndc-confgen -a -r /dev/urandom $ARGS || echo "."
+ set -e
+ fi
+ test -z "$CONF" || ARGS="$ARGS -c $CONF"
+ echo -n "Starting domain name daemon: $NAME"
+ trap 'echo failed' 0
+ start-stop-daemon -S -x $DAEMON -- $ARGS
+ trap - 0
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping domain name daemon: $NAME"
+ rndc stop || start-stop-daemon -K -x $DAEMON
+ echo "."
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start && exit $?
+ ;;
+ reload|force-reload)
+ rndc reload && exit $?
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}"
+ exit 1
+esac
+
+exit 0