[nsd-users] Does NSD delay re-opening of its log file?
wouter at nlnetlabs.nl
Mon Feb 20 08:06:43 UTC 2017
On 18/02/17 10:53, Anand Buddhdev wrote:
> I've observed something strange on some of our busy servers. Logrotate
> reports something like this:
> gzip: stdin: file size changed while zipping
> So here's what logrotate does:
> 1. mv nsd.log nsd.log.old
> 2. runs "nsd-control log_reopen"
> 3. gzip nsd.log.old
> Occasionally, when performing step 3, gzip complains that the input file
> size changed, meaning that NSD was still writing to it.
> Is it possible that NSD delays re-opening of the log file?
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.
Or maybe make log_reopen wait until the reopen has finished, not sure
how to accomplish that...
Best regards, Wouter
> nsd-users mailing list
> nsd-users at NLnetLabs.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the nsd-users