How to gracefully shutdown bind10 noninteractively

Spain, Dr. Jeffry A. spainj at countryday.net
Tue Dec 6 02:19:30 UTC 2011


>> I would like to create an initialization script /etc/init.d/bind10 for Ununtu Oneiric that can start, stop, and restart bind10. To shutdown bind10, I understand that I can log into bindctl and issue the "Boss shutdown" command. Can you recommend a way to do this noninteractively in the proposed initialization script? Thanks.

> kill (with SIGTERM) the bind10 ("boss") process should have the same affect as 'Boss shutdown' via bindctl.  So, if you create a PID file for it, do "kill `cat ${pid_file}`" in the script should work.

I looked into this issue and found the Upstart package (http://upstart.ubuntu.com/cookbook/) as a component of Ubuntu Oneiric. It appears to be well suited to managing bind10 as a service with the following simple configuration file /etc/init/bind10:

# bind10 - bind10 job file for Upstart
description 'bind10 Domain Name Server'
author      'dig @localhost -c CH -t TXT authors.bind'

start on runlevel [2345]
stop on runlevel [!2345]

exec /usr/sbin/bind10 --user=bind

Upstart automatically keeps track of the PID of the main bind10 process and sends SIGTERM to it following the console command 'stop bind10'. After a configurable amount of time, default 5 seconds, it sends SIGKILL if the process is still running. The command 'reload bind10' sends SIGHUP. Does bind10 respond to this signal as well?

Thanks. Jeff.

Jeffry A. Spain
Network Administrator
Cincinnati Country Day School




More information about the bind10-users mailing list