[ntp:questions] ntpd interfacing with newsyslog/logrotate?

unruh unruh at invalid.ca
Sat Apr 21 20:33:55 UTC 2012


On 2012-04-21, A C <agcarver+ntp at acarver.net> wrote:
> Does anyone familiar with NetBSD know if there's a particular 
> configuration for newsyslog that will allow the main ntpd log to rotate 
> on a regular basis?  It seems that ntpd loses track of its log file 
> during a rotate and stops updating.

I do not know, but it is possible that ntpd does not regualrly close its
log files. Thus when the log file gets moved (renamed) and a new log
file opened, ntp keeps using the old one (remmeber that the files are
not referenced by name but by inode). So look in the old file and see if
it is being updated. Then you have to persuade ntpd to close the old log
files and then reopen which will open the new one. 
For example, chorny has the command you can issue in chronyc to close
ant then reopen the log files called cyclelogs. That does not help you
for ntpd, except that it may have an equivalent command you can issue
through ntpq. Of course, you could always stop and then restart ntpd,
but that is a brute force which could mess up timing for awhile. 



More information about the questions mailing list