[bind10-dev] daemonize bind10 and logging

Jeremy C. Reed jreed at isc.org
Thu Dec 8 15:06:26 UTC 2011


I have been attempting to write startup scripts for bind10 on a few 
platforms. This includes writing a full rc.d style script for FreeBSD.

On one system I use:

sudo nohup /home/reed/opt/bind10/sbin/bind10 --verbose >>/home/reed/work/isc/bind10/bind10.log 2>&1 &

On other system, FreeBSD's daemon(8) is used to detach from terminal. 
(Daemon can redirect stdin, stdout, stderr to /dev/null and save pid.)

Another user uses Ubuntu Upstart.

Some problems are:

- bind10 doesn't daemonize itself. It runs on the terminal. So if is in 
a shell script you will need to background it (&).

- dumps logging to terminal by default. Often startup scripts don't 
collect log output, so over time I don't know where this noise will go.

I want to make startup / stop script for other systems too. We need a 
consistent way.

I'd like to suggest we add a daemonize option, that detaches from 
terminal, runs in background, and doesn't output to console except for 
initial startup message or immediate failure message.

If daemonized also don't allow logger to be configured to console. Well 
we could warn instead but I don't know where complaint would be sent. 
Maybe daemonize would default to log to syslog, but overriding 
configurations is confusing.

On a related note, bind10 has a --pid-file option. It only records its 
PID if this switch is used. Maybe we should always record the PID?

  Jeremy C. Reed
  ISC



More information about the bind10-dev mailing list