[nsd-users] Does NSD delay re-opening of its log file?

Anand Buddhdev anandb at ripe.net
Tue Feb 21 10:09:43 UTC 2017

On 20/02/2017 09:06, W.C.A. Wijngaards wrote:

Hi Wouter,

> It communicates the reopen internally over the pipes.  It could be race
> condition, where the gzip starts before the reopen has finished.  sleep
> 1 or sleep 2 before calling gzip would solve that.

This is probably right. When looking at the log files around this time,
it looks like NSD was still busy applying an XFR and reloading a zone,
so it still keep writing to the old log file. But logrotate doesn't know
this, so it starts compressing the old log file.

Logrotate has an option called "delaycompress" that will not compress
the rotated log file. It will only compress it the following day. I
could use this, as disk space isn't a problem for us.

I could add a delay to the compress program, but it would apply to all
logs, so it's not ideal.

I could also add a delay after the call to "nsd-control log_reopen".
I'll think about this, and see what the best solution is.

> Or maybe make log_reopen wait until the reopen has finished, not sure
> how to accomplish that...

Well, if a process receives a command, such as "log_reopen" can it not
report back when it has actually done that?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/nsd-users/attachments/20170221/13a8f94e/attachment.bin>

More information about the nsd-users mailing list