Re: Servers reachable, but can't sync



At 9:07 AM -0700 2005-09-08, Greg McCann wrote:

 I am stumped.  The communications seem to be perfect, and the -q
 mode functions flawlessly.  Yet in -b mode, after communication
 with the server is complete, ntp decides for unexplained reasons
 that it was "not suitable".

 I don't know what else I can do to troubleshoot this without going
 into the ntp source code, which I am not really qualified to do.

Reading the official documentation for ntpdate at <http://www.eecis.udel.edu/~mills/ntp/html/ntpdate.html>, I see that using the "-b" option is supposed to force the system to always step the time with the settimeofday() system call, even in those circumstances when it would normally just slew the clock with the adjtime() system call, such as would happen if your offset was less than +/- 0.5 seconds.


Checking the description for the "-q" option, I see that it is used for query only, and doesn't actually set the system clock.


Are you sure you're running these commands as root? If you're not root, you're not likely to have the privileges required to perform the necessary system calls to do the things you want.


Or, maybe you're running on something like SELinux, and even though you're root, the commands are not being given the necessary privileges to actually set the system clock. In that case, you might need to turn off SELinux, or disable the control that SELinux has over the necessary system calls.


Moreover, it doesn't seem to be necessary to use the "-b" option, since ntpdate would go ahead and set the system clock with the settimeofday() system call if you're more than +/- 0.5 seconds off, and slewing the system clock with the adjtime() system call for offsets of less than +/- 0.5 seconds doesn't seem to be such a bad thing.



What happens when you try to run a real "ntpd -gq" instead of ntpdate? Can you show us what the tcpdump looks like? Can you run the programs with the "-d" option, so that we can see some more debugging output, to get a better idea of what's really going on?


When running ntpdate, have you made sure that you don't already have a copy of ntpd running? If so, then you're either going to want to leave ntpd alone and not run ntpdate, or you should stop ntpd before running ntpdate.

Speaking of which, have you looked in your log files to see if there are any entries from ntpdate or ntpd that are complaining about being unable to set the clock? If not, are you sure you've got your /etc/syslog.conf file set up correctly so that you would see these complaints if they were being logged?


There's lots more questions that I could ask, but these just occurred to me off-the-top-of-my-head.


--
Brad Knowles, <brad@xxxxxxxxxxxxxxxxxxx>

"Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety."

    -- Benjamin Franklin (1706-1790), reply of the Pennsylvania
    Assembly to the Governor, November 11, 1755

  SAGE member since 1995.  See <http://www.sage.org/> for more info.
_______________________________________________
questions mailing list
questions@xxxxxxxxxxxxxxxxx
https://lists.ntp.isc.org/mailman/listinfo/questions

.



Relevant Pages

  • Re: [SLE] date command.
    ... It uses very little system resources as opposed to NTP ... I used to run ntpd and it worked just fine. ... ntpdate and ntpd is that ntpdate will adjust the time in one big step, ... effectiveness. ...
    (SuSE)
  • Re: NTPDate v. NTPD
    ... synchronize when a machine is rebooted while NTPD will periodically check ... I'm operating off of the assumption that the "ntpdate" entries will take ... need to have a config file to specify those. ... the system clock that will otherwise happen some time after boot if the ...
    (comp.unix.bsd.freebsd.misc)
  • Re: executing ntpdate on boot - seems it doesnt work
    ... --hctosys which sets the system clock to the hardware clock. ... So doesn't hwclock needs to be called before ntpdate? ... connection is coming from) then the current recommendation from the NTP ...
    (Debian-User)
  • Re: how to use "ntpd" to emulate "ntpdate"?
    ... > "The functionality of this program is now available in the ntpd ... the ntpdate program is to be retired from this ... ntp -q may provide the same ... functionality and more accuracy, but it's not quite as simple. ...
    (Fedora)
  • Re: [SLE] NTP & SUSE 9
    ... And how often does the ntpd client tune its clock (accordingly to the ntpd ... I use ntp on both my desktop systems, ... But I use ntpdate on my notebook, ... > frequency adjustment, but then it seems to stay very constant. ...
    (SuSE)