[nsd-users] Does NSD delay re-opening of its log file?
W.C.A. Wijngaards
wouter at nlnetlabs.nl
Mon Feb 20 08:06:43 UTC 2017
Hi Anand,
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:
>
> /etc/cron.daily/logrotate:
>
> 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
>
> Regards,
> Anand
> _______________________________________________
> nsd-users mailing list
> nsd-users at NLnetLabs.nl
> https://open.nlnetlabs.nl/mailman/listinfo/nsd-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/nsd-users/attachments/20170220/973f3c2d/attachment.bin>
More information about the nsd-users
mailing list