hwclock never updates drift factor in /etc/adjtime if time is always set more than once a day

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the last calibration was less than 23 hours ago, hwclock [--set | --systohc]
refuses to adjust the drift factor in /etc/adjtime but records the current time
as last calibration time. Thus, a stale drift factor will persist forever on a
machine that is booted more than once a day (quite common on laptops) with
hwclock --systohc in a shutdown script.

There is no warning unless run with --debug. Documentation says: "Every time
you calibrate (set) the clock (using --set or --systohc ), hwclock recalculates
the systematic drift rate based on how long it has been since the last
calibration".

Options to fix this:

1. Just print a warning when the drift factor was not adjusted and update the
   man page.

2. Reduce the required minimum time since the last calibration to a value that
   is more likely to be exeeded (maybe 3 hours).

3. Add an option to select the required minimum time.

4. Add a value to /etc/adjtime that records calibration amounts, making it
   possible to defer drift factor adjustments until the 23 hours are reached.

If an extension to the /etc/adjtime format is acceptable, I'm willing to code
option 4.

Also, hwclock lacks an --initadjfile option to start over with a fresh
/etc/adjtime (current workaround is to remove it by hand before invoking
hwclock).
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux