ntpd troubleshooting (was Re: Is it just me, or...)

Adam Myrow amyrow at midsouth.rr.com
Mon May 8 20:41:09 EDT 2006


Are you sure ntpd is setting the clock?  As root, type "ntpq -p" and see 
what you get.  It should list what servers are being used for 
synchronization.  One of them will have a "*" next to its name.  That is 
the one that is being used at the moment.  Look over your logs for 
messages from ntpd as well.  You should see things like this when ntpd 
first starts.

May  7 20:31:52 dell ntpd[3661]: synchronized to 64.81.227.163, stratum=3
May  7 20:31:54 dell ntpd[3661]: time reset +0.532452 s

This shows what server was picked initially, and that my time was off by 
just over a half second.  If you are getting frequent time resets, it 
could be that something is messing up the clock.  Linux does not use the 
CMOS clock once it starts.  It gets the time from it with the "hwclock" 
utility, then keeps its own clock.  At shutdown, it writes the time back 
to the CMOS clock.

If ntpd isn't able to contact any servers, check /etc/ntp.conf for any 
lines that start with "restrict."  Comment them out, and restart ntpd. 
If ntpd starts working, that was the problem.  In particular, the 
"notrust" parameter can prevent ntpd from working.  Lastly, unless you 
pass the "-N" option to dhcpcd, it may replace your /etc/ntp.conf file 
with a useless one.

If all this fails, kill ntpd, and try to use ntpdate to set your clock. 
Use the syntax "ntpdate pool.ntp.org" replacing the server with one or 
more that you want to use.  If this fails, there is probably a firewall 
problem.





More information about the Speakup mailing list