3

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

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 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.

4
  • What does ntpq -p say?
    – James
    Jan 12, 2010 at 17:20
  • 3
    Your firewall isn't blocking it is is?
    – Chopper3
    Jan 12, 2010 at 17:20
  • Could you run ntpq -pn and post the output? Jan 12, 2010 at 17:22
  • I've edited to add this.
    – Nick
    Jan 12, 2010 at 17:29

4 Answers 4

2

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.

2
  • Thanks - there were some error messages there - I've updated the original post.
    – Nick
    Jan 12, 2010 at 17:32
  • The reach being 0 is a clear indicator that no valid responses (if any) are received. At that point this answer does not make much sense for the question being asked.
    – U. Windl
    Nov 2, 2020 at 8:37
3

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?

1
  • The OP did not comment on this, while I think this is a valid explanation. Maybe some "extra" security mechanism or as bad routing setup?
    – U. Windl
    Nov 2, 2020 at 8:38
1

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.

1
  • This answer is not very helpful: Yes, ntpd resolves host names to IP addresses once and continues to use those, nut (meanwhile at least) it can detect new interfaces during runtime.
    – U. Windl
    Nov 2, 2020 at 8:41
0

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

1
  • The existence of LOCAL(0) is not really related to the problem (and this should not be part of the answer IMHO), but you are right about reach being 0.
    – U. Windl
    Nov 2, 2020 at 8:42

You must log in to answer this question.

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