> > Where can I find a client for Linux which connects to one of the large
> > timeservers on the Internet and resets the time of my Linux box. (Mine is
> > running ahead 40 minutes after 2 days...)
> My Slackware system has netdate, which is in /usr/sbin. I use it like
> this:
> /usr/sbin/netdate tcp 132.163.135.130
> Unfortunately, I don't know if it is available in other dist's.
I can reassure you up to a point: Debian 1.3, at least, has netdate.
And to the original question, let me add that such unruly clocks can
often be tamed though the services of the adjtimex program (not to be
confused with the adjtimex() system call). The server box here has a
typical cheap system clock that caused the Linux RTC to gain (or lose,
I forget now) a minute or two a day. After a while I got tired of
resetting it (using netdate - much easier that way) and measured the
drift over a period of several days and installed a correction by way
of adjtimex. I've done a bit of fine-tuning since then, and the drift
is now well under 1 second/week (11 days uptime, and I believe I
re-synced to a reliable outside clock right after the last boot:
netdate is reporting an error of 0.4 seconds right now). The chief
drawback to adjtimex is the need to translate a calculated drift in,
say, seconds/day, into the multi-valued correction factors.
Now the chief timekeeping error seems to be the drift between the
point in shutdown where I set the CMOS clock from the system time
until the system clock reloads from the CMOS clock at boot time. For
the server, this is a short enough interval, and occurs infrequently
enough, that I just check it from time to time. I don't think I've
reset the system time since the last time we had a long power outage:
the uncorrected CMOS clock drifted more than five or ten seconds while
the machine was shutdown that evening.
The traditional approach - mentioned in some HOWTO or another, I think
- is to run xntpd or some such for a while and then freeze the
"adjtimex" values it has settled on. I imagine this works, but I
thought it would be more trouble to get that working than to measure
the drift and setup the correction myself. I may have been wrong - it
depends on how close the xntpd-determined correction would have set
the clock to correct. :-)
Luck!