[PLUG] automatic running of ntpdate

Dale Snell ddsnell at verizon.net
Thu Dec 3 16:05:00 UTC 2009


On Wed, 2 Dec 2009 21:15:45 -0800
Denis Heidtmann <denis.heidtmann at gmail.com> wrote:

> Data:  ntpdate runs during boot and logs an offset of something from
> .3 to .9 seconds.  A short time after boot runing ntpdate from the
> command line reports an offset of .00##--something close to zero.
> Shutdown and reboot shortly later, ntpdate runs during boot and logs
> an offset of something from .3 to .9 seconds. Repeat as desired.
> 
> I take this to mean that 1) the hardware clock was not synchronized
> better than 1 second on shutdown, or 2) the hardware clock gets bumped
> during the shutdown/reboot cycle, or 3) the hardware clock is unstable
> in the extreme, or 4) the system clock gets set to the rtc to within 1
> second on boot.  1) and 4) seem to me to be effectively the same
> thing.
> 
> I vote for 4), because I find in the logs:
> Dec  2 17:58:46 R2D4 kernel: [    3.906800] rtc_cmos 00:08: setting
> system clock to 2009-12-03 01:58:34 UTC (1259805514)
> 
> If it were set more accurately than the nearest second why would it
> not show in the log?
> 
> -Denis

Denis,

You might want to look in to using adjtimex(8) and hwclock(8) to keep
your hardware clock reasonably accurate for those times when you can't
be connected to the Net.  I used them with my first laptop.
Essentially, you create a correction factor for the hardware clock
and store it to disk.  Then you use it to periodically adjust the
values in the hardware clock.  (Much simpler than trying to adjust
the hardware! :-) )  I found that the hardware clock became about as
accurate as my digital wristwatch -- about a second of drift per
month.  Good enough for most purposes, I'd think. It does take time to
get the thing trained (I wound up leaving my laptop running for a week
at one point), but it does work.  I also had to modify the bootup and
shutdown scripts slightly so that things ran the way that I needed.  

Just a thought.

--Dale

--
Q.  What lies at the bottom of the ocean and twitches?
A.  A nervous wreck.




More information about the PLUG mailing list