clock synchronization

Rick Thomas yellowdog-general@lists.terrasoftsolutions.com
Tue Jun 22 00:26:00 2004


Ray,

NTP will do everything you need.  It will set the clock at boot 
time, as well as keeping track of how much the system RTC drifts 
and correct for that (On Yellowdog, it keeps the needed parameter 
in the file "/etc/ntp/drift".  Other systems put it in other 
places...) It periodically checks with the server(s) and updates 
the "drift" parameter (and others, as well) as needed.  There will 
be no need for you to manually fiddle with the RTC parameters.

The only reason I can think of to prefer adjtimex over NTP is if 
you are on a dial-up link.  NTP picks its own times to poll its 
servers without first checking to see if you are dialed up.  It 
assumes that the Internet is "just there".


Enjoy!

Rick

PS: And, yes, it would probably be a good idea to replace the 
battery.  That's one thing (out of many!) that can cause the clock 
to drift.

On Sunday, June 20, 2004, at 09:40 AM, R. Hirschfeld wrote:

> For some reason my system clock has started running slow. losing about
> 26 seconds per day.  The hardware clock is accurate, but since the
> hardware clock is set to the system clock at shutdown, it gets
> corrupted by the bad system clock.
>
> To remedy this, I installed the adjtimex package and used it to modify
> the kernel time variables, setting 10003 instead of 10000 microseconds
> per tick.  This helped considerably, although I'm still playing with
> the frequency variable to improve the accuracy.
>
> What's a good way to set this automatically at boot time rather than
> having to do it every time by hand?  Would it be in the spirit of how
> startup configuration works in YDL to add something like the following
> to /etc/rc.d/rc.sysinit (just before the line that runs hwclock):
>
> if [ -x /sbin/adjtimex ]; then
>   [ -n "$TICK" ] && ADJTIMEXFLAGS="$ADJTIMEXFLAGS -t $TICK"
>   [ -n "$FREQ" ] && ADJTIMEXFLAGS="$ADJTIMEXFLAGS -f $FREQ"
>   [ -n "$ADJTIMEXFLAGS" ] && /sbin/adjtimex $ADJTIMEXFLAGS
> fi
>
> and then specify TICK=10003 and FREQ=whatever in /etc/sysconfig/clock?
> Or would that be asking for trouble by breaking other programs'
> assumptions about the contents of the config file?
>
> If I instead use ntp to synchronize with a time server, does it still
> make sense to set the tick and frequency at startup as a "head start",
> or does ntpd maintain this information between sessions?
>
> Thanks,
> Ray