clock synchronization

Julian Opificius yellowdog-general@lists.terrasoftsolutions.com
Mon Jun 21 22:12:00 2004


On Jun 21, 2004, at 16:19, Longman, Bill wrote:

>> 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?
>
> Ray, NTPD does a good job of keeping track of the hardware realtime 
> clock.
> According to the man page, at least, it provides a mechanism to slew 
> the
> clock so that after some learning, it tweaks the kernel similar to what
> you've done in the above script.
>
> You may also want to read the man page for "hwclock".
>

Or you may just want to change the battery.

-- 
J.