Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am attempting to use ntp on the server.

Checking ps the ntpd process seems to be running:

ntpd -u ntp:ntp -p /var/run/ntpd.pid -g

However the time is not being corrected, any ideas?

The drift is about 2 minutes per month, which is not a problem according to an answer to an earlier question I asked. I understand it can take some time to correct a badly drifted time but I corrected the time recently to an accurate value.

(Server details - Cent OS, Linux version 2.6.9.)

Results of ntpq -pn

 72.14.188.52    .INIT.          16 u  62h 1024    0    0.000    0.000 4000.00
 4.79.132.217    .INIT.          16 u  10d 1024    0    0.000    0.000 4000.00
 72.14.179.211   .INIT.          16 u  62h 1024    0    0.000    0.000 4000.00
*127.127.1.0     LOCAL(0)        10 l    2   64  377    0.000    0.000   0.004

Contents of /etc/log/messages

Jan 10 04:21:36 server1 ntpd[18417]: sendto(72.14.188.52): Operation not permitted
Jan 10 04:21:41 server1 ntpd[18417]: sendto(72.14.179.211): Operation not permitted
Jan 10 04:22:13 server1 ntpd[18417]: sendto(4.79.132.217): Operation not permitted
Jan 10 04:38:41 server1 ntpd[18417]: sendto(72.14.188.52): Operation not permitted
....

Update

Thanks for the responses. I've updated the firewall settings and no more messages have been appended to etc/log/messages, so it looks like a problem has been resolved. I'll give it some more time to see what happens.

share|improve this question
3  
Your firewall isn't blocking it is is? –  Chopper3 Jan 12 '10 at 17:20
    
Could you run ntpq -pn and post the output? –  Jeff Snider Jan 12 '10 at 17:22

5 Answers 5

up vote 3 down vote accepted

Are there any ntpd messages in /var/log/messages? As I was dealing with my EC2 NTP issues I noticed that NTP didn't like being too far out of sync and wanted a manual update. Perhaps you're too far out for it to decide it will update for you.

share|improve this answer
    
Thanks - there were some error messages there - I've updated the original post. –  Nick Jan 12 '10 at 17:32

The "operation not permitted" errors make me wonder if NTP is trying to talk from or open its privileged port (123) but is not running as root.

Can you confirm that either NTP is running as root, or is running a version with the appropriate permissions to open port 123?

share|improve this answer

What does ntpq -p say?

share|improve this answer
    
I've edited to add this. –  Nick Jan 12 '10 at 17:29

My experience with this issue happens when one of my hosts has an IP address change. NTP tends to open sockets specific to an interface. Try restarting NTP and see if it behaves.

share|improve this answer

You should remove the local clock definition in your ntp config. This is a left over from a long time ago. See the column with "0"s for all the ecternal time sources? They have never been successfully polled. The 377 for the LOCAL clock means that it has been successfully polled many times.

Please post a new ntpq -pn

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.