Bug 739 - NSD does not honor modified zone files when mtime diff is too small
NSD does not honor modified zone files when mtime diff is too small
Status: RESOLVED FIXED
Product: NSD
Classification: Unclassified
Component: Zonec Code
4.1.x
x86_64 Linux
: P5 minor
Assigned To: NSD team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-24 01:57 CET by nsd
Modified: 2016-01-29 10:08 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nsd 2016-01-24 01:57:29 CET
We do offline zone signing. Signed zone files for all stages of ZSK rollover are generated at once by a script, copied to our nameservers and applied at appropriate time. Due to this approach zone file's mtimes differ only by some 100 ms:

# ls --full-time files/nsd-signed/
-rw-r--r-- 1 root root 42966 2016-01-19 14:50:09.035983652 +0100 ccczh.ch.zone.rolled
-rw-r--r-- 1 root root 42966 2016-01-19 14:50:08.027312998 +0100 ccczh.ch.zone.signed
-rw-r--r-- 1 root root 42966 2016-01-19 14:50:08.403970283 +0100 ccczh.ch.zone.spub

nsd does not apply the new zone files neither on SIGHUP nor on full restart.

however according to man 8 nsd:
       SIGHUP Reload.  Scans zone files and if changed (mtime) reads them in.
Comment 1 Wouter Wijngaards 2016-01-25 09:02:04 CET
Hi,

Yes we have only whole seconds from the POSIX system call.

Best regards, Wouter
Comment 2 nsd 2016-01-25 16:05:33 CET
> Yes we have only whole seconds from the POSIX system call.
If you're going to keep it that way, I'd greatly appreciate mentioning that in the man page, e.g. by replacing:
(mtime) -> (mtime, resolution: seconds)
Comment 3 Wouter Wijngaards 2016-01-29 10:08:39 CET
Hi,

Implemented the fix, it now checks the mtime in seconds and nanoseconds.  The patch is committed to the source repository.

Thank you for the report.

As an aside, it will now also reread in the file if the timestamp is smaller, but different.  I.e. time adjustments on the system.

Best regards, Wouter