New installation of BIND on Oracle Linux

Tony Finch dot at
Wed Dec 2 10:54:10 UTC 2015

chris liesfield <chris.liesfield at> 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

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
	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

f.anthony.n.finch  <dot at>
Fisher: Southwest 5 to 7 veering northwest 4 or 5. Moderate or rough. Fair
then rain. Good, becoming moderate or poor.

More information about the bind-users mailing list