kumquat-buildroot/package/bind/bind.sysvinit
Eric Andersen cb7b678a5e 664: bind package update: akvadrako writes:
This patch consists of:
 (1) bind version bump
 (2) removing some X-compiling build fixes merged upstream
 (3) removing the bind-dlopen patch: not of general enough use
 (4) remove the package/bind/bind9 file - it isn't used
 (5) Use $(STAGING_DIR)/lib instead of $(STAGING_DIR)/usr/lib
 (6) Fix chroot'ed bind handling by init script
2006-04-14 19:25:54 +00:00

57 lines
1.1 KiB
Bash

#!/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 "Initializing $NAME control key: rndc-confgen"
set +e
# if rndc.key is a symlink, the target must exist
touch $CHROOT/etc/rndc.key
touch etc/rndc.key
rndc-confgen -a -r /dev/urandom $ARGS || true
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 || true
sleep 2
$0 start
;;
reload|force-reload)
rndc reload || $0 restart
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac
exit 0