0

I have an ntpd server running on to provide time for all pc's inside my office. lately it has started switching off unexpectedly.

there is nothing in the logs:

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

the config is

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

I should perhaps note that the ntp deamon listens on all interfaces (2 ethernet + 2 vpn-tun) but the firewall only allows requests from the intranet - not the vpn, nor the internet interface.

what could be wrong and ntpd just quits?

2 Answers 2

1

hm so running ntpd -g -d from command line, provided the answer:

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.

the date was more than 1000 seconds off and as a result ntpd would exit. the weird is this vital info was not printed in the log.

anyhow, running it directly (ie. not through the rc.init scripts) with verbose output provided the answer.

1
  • The fact that a PC clock might be totally off (maybe because of a bad battery, maybe because of some kind of dual boot with bad behaving OS) is a good reason to call ntpdate before ntpd is started. Ntpdate will set the time against given server even when the clock is more than 1000 seconds off. Jan 24, 2015 at 21:26
1

Modify the default rc.ntpd script to invoke ntpdate during the start and restart actions. This way if the clock is more than 1000s off, it will still be updated.

I believe that ntpdate will update the hardware clock by default - it might need an optional switch to do so.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .