ntpd服务器意外closures

我有一个ntpd服务器运行,为我的办公室内的所有电脑提供时间。 最近它已经开始意外closures。

日志中没有任何内容:

30 Aug 02:25:43 ntpd[1590]: peers refreshed 30 Aug 02:25:43 ntpd[1590]: new interface(s) found: waking up resolver 30 Aug 02:25:45 ntpd[1949]: DNS 0.europe.pool.ntp.org -> 62.237.86.234 30 Aug 02:25:47 ntpd[1949]: DNS 3.gr.pool.ntp.org -> 193.93.167.241 30 Aug 02:25:47 ntpd[1949]: DNS 3.europe.pool.ntp.org -> 149.210.163.34 30 Aug 02:25:52 ntpd[1590]: Listen normally on 10 tun1 192.168.26.18 UDP 123 30 Aug 02:25:52 ntpd[1590]: peers refreshed 30 Aug 02:25:52 ntpd[1590]: new interface(s) found: waking up resolver 7 Sep 06:16:36 ntpd[25112]: Listen normally on 10 multicast 224.0.1.1 UDP 123 7 Sep 06:16:36 ntpd[25112]: Joined 224.0.1.1 socket to multicast group 224.0.1. 1 

configuration是

 cat /etc/ntp.conf | egrep -v "^(#|$)" server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 server 3.gr.pool.ntp.org server 3.europe.pool.ntp.org server 0.europe.pool.ntp.org driftfile /etc/ntp/drift multicastclient 224.0.1.1 # listen on default 224.0.1.1 broadcastdelay 0.008 restrict default kod nomodify notrap noquery nopeer restrict pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 0.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 1.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 2.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 192.168.18.0 mask 255.255.255.0 nomodify notrap restrict 127.0.0.1 logfile /var/log/ntp.log 

我也许应该注意到,ntp deamon侦听所有接口(2 ethernet + 2 vpn-tun),但防火墙只允许来自内部networking的请求 – 不是vpn,也不允许互联网接口。

什么可能是错的, ntpd刚刚退出?

hm这样从命令行运行ntpd -g -d ,提供了答案:

 clock_update: at 260 sample 260 associd 48025 event at 260 0.0.0.0 0617 07 panic_stop -10796 s; set clock manually within 1000 s. 

date超过1000秒,因此ntpd将退出。 奇怪的是这个重要的信息没有打印在日志中。

无论如何,直接运行它(即不通过rc.init脚本)与详细的输出提供了答案。

修改默认的rc.ntpd脚本以在启动和重新启动操作期间调用ntpdate。 这样,如果时钟超过1000秒,它仍然会被更新。

我相信ntpdate默认会更新硬件时钟 – 它可能需要一个可选的开关来完成。