The 2004-09-18 at 00:13 -0300, Marcos Vinicius Lazarini wrote:
I was trying to fix a clock systematic drift in an old 486 running debian stable, and found this interesting text about hwclock: ---------- File: /usr/share/doc/util-linux/README.Debian.hwclock.gz .... Issues with hwclock --adjust:
hwclock has a facility to try to correct for systematic drift in the hardware clock, accessed by hwclock --adjust. This facility is *dangerous* because it has a severe drawback: it assumes that no program other than hwclock --systohc will ever be used to change the hardware clock.
That's correct.
This assumption is often false, as many common utilities such as ntp, chrony, as well as your computer's System Setup BIOS program, and any other OS you have in your machine will change the clock.
Exactly. This is specially true for dos/windows. However, if you are aware of the problem, you take your measures. Notice that if you use ntp, the suse scripts will automatically call hwclock at system shutdown: this is taken into account, no need to do manual adjustements.
Also, if hwclock --adjust is used, one must make sure the drift file (/etc/adjtime) is deleted every time the system clock is set to a very different value (even if you're using hwclock itself to do it!), or the drift computation might become invalid and cause the hardware clock to be incorrectly set the next time hwclock --adjust is used.
Absolutely correct. Notice that several people have recomended deleting that file after setting up the clock: it is a known issue.
hwclock currently does not perform any sort of sanity checks in the values it uses to compute the drift file, and will corrupt your clock time by potentially very large amounts if anything goes wrong.
Yes. If it happens, delete the adjtime file, and problem solved.
Don't use the hwclock --adjust facility, refer to alternate (and much safer) programs such as ntp or chrony if you need precision timekeeping.
Then you have to delete or edit som suse scripts, because it is called by default. You can find my writeup on how suse handles the clock in the unofficial suse faq, howtos section. -- Cheers, Carlos Robinson