[ntp:questions] Correcting a large time difference
unruh at wormhole.physics.ubc.ca
Sat Jul 31 15:50:48 UTC 2010
On 2010-07-31, Terje Mathisen <"terje.mathisen at tmsw.no"> wrote:
> Richard Heritage wrote:
>> I've inherited a RHEL 5 server that isn't running ntp and whose clock
>> is about 30 minutes fast. What I would like to do is start ntpd&
>> have it gradually correct the clock. I don't care how long it
>> takes--it's been running this way for months. The server runs an
>> email application that may be sensitive to a large backward jump in
>> the clock, and leaving the server down for a half hour isn't a good
>> I don't know ntp very well, but from reading it appeared to me that
>> if I put "tinker panic 0" in ntp.conf and started ntp with the -x
>> option it would do what I want. However, on a test server the
>> correction occurred all at once. Is there a way to accomplish what I
> Yes, but you might have to do it semi-manually:
> Set the server to use itself as a reference(LOCAL_CLOCK) and with an
> ntp.drift file with the maximum slew rate (either 500 or -500, check the
> sign you need!), then sit back and wait/monitor until the clock is
> either exactly right or a tiny amount slow, before restarting ntp with a
> proper ntp.conf with external sources enabled.
> With 500 ppm you drop one second every 2000 seconds, so half an hour
> requires 1000 hours or about 41 days!
> The other alternative might be easier: Use tickadj directly to slow down
> the clock, with the proper value you could bring it into (approximate)
> line in a few days before restoring tickadj and starting ntpd.
This is basically what chrony does. It uses both the freq and the
tickadj to disciplne the clock (tickadj for big stuff). It then
disciplines the clock a factor of 2-20 times better than ntpd.
> It is possible that you would be able to use chrony, which is supposed
> to be much more accommodating in a situation like yours.
More information about the questions