Package: util-linux
Version: 2.12-10

The init scripts for program, hwclock, have been dysfunctional for
many years regaring use of the --adjust utility.  I've filed bug
reports before but the problem was never satisfactorily fixed.  Right
now the README just says not to use the adjust capability.  So the fix
to using adjust was just saying not to do it instead of fixing the
problem.

But I've been using this feature and it works fine.  It compensates
for a fast or slow hardware clock (battery powered) on ones PC.  It's
a major feature of the hwclock program and should not just be ignored
because the script hasn't be fixed to handle it correctly.

So at least there is a problem with the documentation in
the README file and /etc/init.c/hwclock.sh:

[snip]
case "$1" in
        start)
                if [ ! -f /etc/adjtime ]
                then
                        echo "0.0 0 0.0" > /etc/adjtime
                fi

                # Uncomment the hwclock --adjust line below if you want
                # hwclock to try to correct systematic drift errors in the
                # Hardware Clock.
                #
                # WARNING: If you uncomment this option, you must either make
                # sure *nothing* changes the Hardware Clock other than
                # hwclock --systohc, or you must delete /etc/adjtime
WRONG: hwclock --set --date= ...  also makes a calibration just like
--systohc does.  Also, the script does --systohc at each shutdown.  But
when a --systohc (a calibration) is done, the program assumes that the
sys clock is the correct time, but usually it's not, so there needs to
be a provision to disable the use of --systohc at shutdown in order to
use adjust.  To do this I've created HWCLOCKSET for the script and set
it to no.  The script does have HWCLOCKACCESS.  Setting it to  = no
stops all access to the hw clock but access is needed to set the time
from the hw clock each time the PC is powered on.

                # every time someone else modifies the Hardware Clock.
                #
                # Common "vilains" are: ntp, MS Windows, the BIOS Setup
                # program.
                #
                # WARNING: You must remember to invalidate (delete)
                # /etc/adjtime if you ever need to set the system clock
                # to a very different value and hwclock --adjust is being
                # used.
or if you use this file on another computer (such as swapping hard drives).
                #
                # Please read /usr/share/doc/util-linux/README.Debian.hwclock
                # before enablig hwclock --adjust.
                #
                 hwclock --adjust $GMT $BADYEAR


>From the README: (my comments deliniated by -----------------)
hwclock and Debian:

A Debian installation will, by default, call hwclock --hctosys during system
startup and hwclock --systohc during system shutdown.

To set the date/time of the system, just use the standard UNIX date facilities
(such as date) or any of the advanced timekeeping utilities (ntp, ntpdate,
chrony).
------------------------------------------------------------------------
unless you're using --adjust;  or unless you're setting the time each
time the PC is powered up.
-------------------------------------------------------------------------
Other methods of setting the clock (such as hwclock) are likely to 
cause trouble, do not use them.

Please note that because the shutdown scripts call hwclock --systohc, you
cannot set the clock using hwclock only, as your adjustment will be lost on
the next reboot. THIS MEANS YOU MUST *NOT* FOLLOW THE PROCEDURES IN THE
hwclock(8) MAN PAGE TO SET THE CLOCK DATE/TIME USING A REBOOT UNLESS YOU
EDIT THE SHUTDOWN SCRIPTS.
--------------------------------------------------------------------------
Should a README contradict a man page?  No!
-------------------------------------------------------------------------
[snip]
Don't use the hwclock --adjust facility, refer to alternate (and much safer)
programs such as ntp or chrony if you need precision timekeeping.
-------------------------------------------------------------------------
The way I set the hw clock is using hwclock --set --date "13:34:44"
etc.  I do this just after I set my wristwatch for the correct time,
using the time supplied by the phone co. (you dial a time recording)
or from the US Gov't time on the Internet.  If the adjust time utility
is working OK, it doesn't need to be set often since systematic drift
of the hw clock is automatically compensated for.

So there needs to be a documented option of using the adjust utility
and a variable in the script to set or comment out if one wants to use
it.  

                        David Lawyer


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to