bind 9.2.1 slow closing UDP socket

Simon Waters Simon at wretched.demon.co.uk
Wed May 22 21:12:01 UTC 2002


chris wrote:
> 
> > Do you get the 'exiting' message?
> 
> Actually, it logs exiting *30 seconds* after it logged 'no longer listening on
> 127.0.0.1#53'. 

Is the logging synchronous?

> At least now I know how long I should have waited, but
> why so long?  Other times I can see it logged exiting long after the new
> one started (20 seconds), but the new one was able to start with no
> problems.

Quick look at the code shows it is mostly empty from here.

Do you have a big blackhole ACL, or use a database interface
(sdb)?

> > What does this script look like?
> 
> basically:
> 
> rndc stop
> kill `cat /var/run/named.pid`   # redundant most of the time

Hmm maybe this is a race condition, couldn't follow it from a
quick glance at the code. 

Leastwise "rndc stop" should remove named.pid, making the kill
syntax a bit suspect.

So if you must force the issue, at least sleep before kill, and
check for named.pid existing.

I find I don't have a problem with this on Linux...

case "$1" in
  start)
        # Start daemons.
        echo -n "Starting named: "
        /usr/local/sbin/named -u named -t /home/named -c
/named.conf
                RETVAL=$?
                [ $RETVAL -ne 0 ] && logger -p daemon.emerg
"named daemon failed
 to start"
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down named: "
                /usr/local/sbin/rndc stop
                RETVAL=$?
        ;;
  restart)
        $0 stop
        $0 start
       
;;                                                                      

But it could be a big server problem as it is mostly freeing
memory, which doesn't usually take a long time, but if you have
128MB....


More information about the bind-users mailing list