Anand Buddhdev
2017-Feb-18 09:53 UTC
[nsd-users] Does NSD delay re-opening of its log file?
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? Regards, Anand
W.C.A. Wijngaards
2017-Feb-20 08:06 UTC
[nsd-users] Does NSD delay re-opening of its log file?
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>