Bug 193 - nsd.conf not reloaded on nsdc reload
nsd.conf not reloaded on nsdc reload
Status: RESOLVED WONTFIX
Product: NSD
Classification: Unclassified
Component: NSD Code
3.0.x
All NetBSD
: P2 normal
Assigned To: NSD team
: 241 257 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-08 17:43 CEST by Joerg Sonnenberger
Modified: 2009-06-22 09:48 CEST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Sonnenberger 2008-07-08 17:43:47 CEST
Adding a new zone to nsd.conf, running nsdc rebuild and nsdc reload results in

Jul  8 15:36:34 www nsd[486]: signal received, reloading...
Jul  8 15:36:34 www nsd[1161]: corrupted database/bad config, zone example.com. in db /var/db/nsd.db, but not in config file. Cannot load database. Please rebuild database and start again.
Jul  8 15:36:34 www nsd[1161]: unable to reload the database: Interrupted system call

in syslog.
Comment 1 Matthijs Mekking 2008-07-09 13:38:20 CEST
My personal opinion is that if you change the configuration, you should restart the program (by invoking nsdc restart, for example). 

However, many dns people from labs are on vacation, so I should discuss this when they get back. Until then: use rebuild/restart instead of rebuild/reload.

Comment 2 Joerg Sonnenberger 2008-07-09 14:27:47 CEST
(In reply to comment #1)
> My personal opinion is that if you change the configuration, you should restart
> the program (by invoking nsdc restart, for example). 

Using restart is fine for me as well. I filled this as bug as I was asked about this behavior (and a possible regression compared to 2.x). The diagnostic message in syslog is misleading at least.
Comment 3 Matthijs Mekking 2008-07-16 11:34:37 CEST
Also in the future, NSD will not reload nsd.conf after invoking a NSD reload. The reason is that we like to keep NSD code clean and one of the ways to do so is to keep file processing and server activities seperate. 

If you add or remove zones, you should continuing using nsdc restart instead of reload (as suggested in the logs).

Kind regards, 

- Matthijs
Comment 4 Joerg Sonnenberger 2008-07-16 14:01:14 CEST
(In reply to comment #3)
> If you add or remove zones, you should continuing using nsdc restart instead of
> reload (as suggested in the logs).

As I said, this is fine with me. But in that case the log message should be changed to say something like "corrupted database / modified configuration, explicitly restart the daemon" or so. As it is, the message is misleading as the database is not corrupt (it was just rebuild) and the configuration file is valid as well.
Comment 5 John Lightsey 2008-07-17 21:03:29 CEST
IMHO the confusing aspect of nsdc's behaviour is that it's providing actions with init script names, but they're behaving differently.  "Reload" typically implies a full reload of the configuration files without any downtime.

See, for example:
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

So really a NSD init script shouldn't alias "reload" to "nsdc reload" since it doesn't "cause the configuration of the service to be reloaded."  It's actually a bug in the init scripts though, since nsdc can use the "reload" action to mean whatever you want.  From what I've seen though almost all of the packaged versions of NSD pass start/stop/restart/reload from the init scripts directly to nsdc.  Examples:

http://open.nlnetlabs.nl/pipermail/nsd-users/2005-October/000437.html
http://ftp.de.debian.org/debian/pool/main/n/nsd3/nsd3_3.0.7-3.diff.gz

NSD init scripts should really skip the "reload" action and make "force-reload" and "restart" invoke nsdc rebuild && nsdc restart.
Comment 6 Matthijs Mekking 2008-07-21 14:05:30 CEST
Hi John, 

I would like to invite you to discuss this on our nsd users mailing list. This way, we can check if more NSD users feel the same way and if it is worth to make such a change that would make nsdc more conform the init script names. 

Please do not hesitate and bring the discussion to nsd-users@NLnetLabs.nl!

Kind regards.
Comment 7 Matthijs Mekking 2009-04-03 12:02:53 CEST
*** Bug 241 has been marked as a duplicate of this bug. ***
Comment 8 Matthijs Mekking 2009-06-22 09:48:54 CEST
*** Bug 257 has been marked as a duplicate of this bug. ***