[ntp:questions] Correcting a large time difference

Terje Mathisen "terje.mathisen at tmsw.no" at ntp.org
Sat Jul 31 06:39:22 UTC 2010


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
> option.
>
> 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
> want?

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.

It is possible that you would be able to use chrony, which is supposed 
to be much more accommodating in a situation like yours.

Terje
-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"




More information about the questions mailing list