named already running?

Ian Smith smithi at nimnet.asn.au
Sat Feb 17 07:18:12 UTC 2007


In freebsd-questions Digest, Vol 165, Issue 19
At Message: 33
On Sat, 17 Feb 2007 00:28:13 +0200 Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:

 > On 2007-02-16 22:56, Andrea Venturoli <ml.diespammer at netfence.it> wrote:
 > > Hello.
 > > 
 > > I'm getting this on several different 6.x servers:
 > > 
 > > > # sh /etc/rc.d/named restart
 > > > Stopping named.
 > > > named already running? (pid=xxx).
 > > 
 > > and named won't restart; if I then
 > > 
 > > > # sh /etc/rc.d/named start
 > > > Starting named.
 > > 
 > > it works fine.
 > > 
 > > Is this happening to other people? What could be the reason?
 > > It's nothing critical, only a bit annoying, but I'm curious...
 > 
 > yes.  I've seen it happen too.  I think it's a timing issue between the
 > process going away and the new named trying to start.  I haven't tried
 > to find the *real* cause of this, but it may be worth filing a problem
 > report, even if it's not a critical bug :)

I've run into this one.  /etc/rc.d/named stop runs 'rndc stop' and start
runs first named_precmd which handles the chroot stuff and sets up rndc.

however rndc itself says (edited for relevance):

gaia# rndc
Usage: rndc [-c config] [-s server] [-p port]
        [-k key-file ] [-y key] [-V] command

command is one of the following:

  reload        Reload configuration file and zones.
[..]
  reconfig      Reload configuration file and new zones only.
  stats         Write server statistics to the statistics file.
  querylog      Toggle query logging.
  dumpdb [-all|-cache|-zones] [view ...]
                Dump cache(s) to the dump file (named_dump.db).
  stop          Save pending updates to master files and stop the server.
[..]
  status        Display status of the server.
  recursing     Dump the queries that are currently recursing (named.recursing)
  *restart      Restart the server.    <<<<<<<<<<<<<<<<<<

* == not yet implemented               <<<<<<<<<<<<<<<<<<
Version: 9.3.2-P2

So 'rncd restart' doesn't (yet) work the same as the older ndc restart;
you have to use 'rncd stop; rndc start' instead, or more consistently:

/etc/rc.d/named stop
/etc/rc.d/named start

.. which works fine, but does blow away all cached data :( I have to do
this every time after resuming my suspended laptop, as named loses its
binding to any IP but localhost, after resuming the LAN pccard .. I
guess it can be argued that a nameserver should never be suspended :) 

(As an aside, rndc stats and rndc dumpdb work here, but I can't get rndc
querylog to do anything at all, a write permission error.  I've tried
all manner of things including creating a zero length named.run in
various places under the chroot .. no dice.  I'll try it again after
building the latest 5.5-STABLE, which has bind 9.3.4 as I recall, but I
suspect querylog might need patching to work in a chroot environment)

Cheers, Ian



More information about the freebsd-questions mailing list