chris liesfield <chris.liesfi...@gmail.com> wrote:
>
> # See how we were called.
>
> case "$1" in
> start)
> # Start daemons.
> echo -n "Starting named: "
> daemon /usr/local/sbin/named -u named -t /var/named -c /etc/named.conf
> echo
> touch /var/lock/subsys/named
> ;;

I often find that it's helpful for rc scripts to ensure the chroot is set
up correctly in the start action: set up device files, directories and
permissions, create rndc.key if it is missing. It's fairly common for rc
scripts which have the option of running named either chrooted or not to
copy files from /etc to the chroot whenever starting or reloading the
server.

Some of the chroot setup can be redundant if you have a good configuration
management tool - I like Ansible.

After starting named I wait for it to finish loading everything (to avoid
races) then fix the permissions on the nsupdate key.

        while   ! rndc status >/dev/null 2>&1
        do      sleep 0.1
        done
        chmod g+r $RUN/session.key

Similarly when stopping:

        # dummy argument in case named is not running
        set $(rndc stop -p 2>/dev/null) "dummy"
        while   kill -0 $2 2>/dev/null
        do      echo -n "."
                sleep 0.1
        done

Tony.
-- 
f.anthony.n.finch  <d...@dotat.at>  http://dotat.at/
Fisher: Southwest 5 to 7 veering northwest 4 or 5. Moderate or rough. Fair
then rain. Good, becoming moderate or poor.
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to