Default gumstix configuration changed
[gumsense-br.git] / package / bind / bind.sysvinit
bloba9babd21537a151d9626ef4827c25726652c2a12
1 #!/bin/sh
3 # System-V init to control the bind DNS Daemon
6 NAME=named
7 DAEMON=/usr/sbin/$NAME
9 # this file contains a few tunable parameters
10 test -r /etc/default/named && . /etc/default/named
12 test -f $DAEMON || exit 0
14 set -e
16 case "$1" in
17 start)
18 test -z "$CHROOT" || ARGS="$ARGS -t $CHROOT"
19 test -z "$SETUID" || ARGS="$ARGS -u $SETUID"
20 if [ ! -f $CHROOT/etc/rndc.key ]; then
21 echo -n "Initializing $NAME control key: rndc-confgen"
22 set +e
23 touch $CHROOT/etc/rndc.key # handle symlinks
24 rndc-confgen -a -r /dev/urandom $ARGS || echo "."
25 set -e
27 test -z "$CONF" || ARGS="$ARGS -c $CONF"
28 echo -n "Starting domain name daemon: $NAME"
29 trap 'echo failed' 0
30 start-stop-daemon -S -x $DAEMON -- $ARGS
31 trap - 0
32 echo "."
34 stop)
35 echo -n "Stopping domain name daemon: $NAME"
36 rndc stop || start-stop-daemon -K -x $DAEMON
37 echo "."
39 restart)
40 $0 stop
41 sleep 2
42 $0 start && exit $?
44 reload|force-reload)
45 rndc reload && exit $?
48 echo "Usage: $0 {start|stop|restart|reload|force-reload}"
49 exit 1
50 esac
52 exit 0