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

Re: Scary bugs



On Sun, Jan 30, 2000 at 11:26:58AM +0100, Thierry Laronde wrote:
> The more --- badly --- surprised is the MS-DOS/Windows user. He is the one
> we must specially take care of. The one using NTP is supposed to know
> what he's doing.

Yes, but that doesn't mean we can't try to please both groups.

> So, my options for potato :
> > 
> > case "$1" in
> >         start)
> >                 if [ ! -f /etc/adjtime ]
> >                 then
> >                         echo "0.0 0 0.0" > /etc/adjtime
> >                 fi
>                   [ "$GMT" = "--utc" ] && hwclock --adjust $GMT
>                   hwclock --hctosys # not dangerous : that's what kernel does

There's no reason to run it at all if it is unneeded.  I have a bit of
distrust of hwclock itself, after some SMP time problems, so I'd rather
be safe and only run it when needed.  Although it seems that it sets the
kernel's notion of the current timezone, so it may be required after
all.  I'd rather just leave the clock alone and only set the TZ,
myself...

Note that hwclock --adjust is useful only when:
	1. All time changes are done with hwclock --set (updating the
	   drift calculation)
	2. Drift is automatically calculated when --systohc runs.

The --adjust line is a NOP if neither of the above two happen, unless
the adjtime file wasn't created with this version of the scripts.  This
will cause problems on upgraded systems, where /etc/adjtime may have
some really crazy drift values that are incorrect.

> >                 #
> >                 #       Now that /usr/lib/zoneinfo should be available,
> >                 #       announce the local time.
> >                 #
> >                 if [ "$VERBOSE" != no ]
> >                 then
> >                         echo
> >                         echo "Local time: `date`"
> >                         echo
> >                 fi
> >                 ;;
> >         stop|restart|reload)
> >                 [ "$GMT" = "-u" ] && GMT="--utc"
>                   #hwclock --systohc $GMT

I see this as creating another 10+ bug reports "my clock doesn't
change after a reboot when I change it", and that being consistent
through potato (One or two opened every few weeks.  The time the user
sees through "normal" use of the system is what should be set back to
the CMOS clock.  It is the --adjust line that causes the warping, not
the --systohc line at reboot time.  Even someone using NTP doesn't
really mind the --systohc at reboot time, since it is, after all, a
reboot.

> >                 if [ "$VERBOSE" != no ]
> >                 then
>                           echo "CMOS clock *NOT* updated !"
> >                 fi
> >                 ;;
> >         show)
> >                 hwclock --show $GMT
> >                 ;;
> >         *)
> >                 echo "Usage: hwclock.sh {start|stop|reload|show}" >&2
> >                 echo "       start sets kernel clock from CMOS clock" >&2
> >                 echo "       stop and reload set CMOS clock from kernel clock" >&2
> >                 exit 1
> >                 ;;
> > esac
> > 

-- 
Ryan Murray, (rmurray@cyberhqz.com, rmurray@stormix.com)
Programmer, Stormix Technologies Inc.
The opinions expressed here are my own.


Reply to: