--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- named.rc6 2004-07-14 19:36:02.000000000 -0400 +++ /etc/init.d/named 2005-04-14 15:43:44.965464927 -0400 @@ -21,19 +21,25 @@ CPU=1 fi - if [ $CHROOT -a -d $CHROOT ] ; then - PIDFILE="${CHROOT}/var/run/named/named.pid" - KEY="${CHROOT}/etc/bind/rndc.key" - else - PIDFILE="/var/run/named/named.pid" - KEY="/etc/bind/rndc.key" - fi + # As with the named.conf test, above, there's no need + # for chroot and non-chroot cases here + PIDFILE=$(grep "pid-file" ${CHROOT}/etc/bind/named.conf | \ + egrep -v ".*[#,//].*pid-file" | \ + head -n 1 | \ + sed -ne 's:.*pid-file \"\(.*\)\";:\1:p') + [ -n "$PIDFILE" ] || PIDFILE=/var/run/named.pid + PIDFILE="${CHROOT}$PIDFILE" + + KEY="${CHROOT}/etc/bind/rndc.key" } start() { ebegin "Starting ${CHROOT:+chrooted }named" checkconfig || return 1 - start-stop-daemon --start --quiet --exec /usr/sbin/named -- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT} + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec /usr/sbin/named \ + -- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT} + eend $? } @@ -62,5 +68,7 @@ restart() { svc_stop + # the pid file is not removed quickly enough + sleep 5 svc_start }