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

Re: Scary bugs



On Sat, Jan 29, 2000 at 05:19:15PM -0800, Ryan Murray wrote:
> On Sun, Jan 30, 2000 at 12:18:11AM +0100, Thierry Laronde wrote:
> > 
> > What is needed --- for woody --- is now *work*. So IMHO, and this would be
> > my last mail for the moment, the average solution for *potato* is to :
> > 
> > 1) modify /etc/init.d/hwclock.sh so that the --adjust action is only set if
> > $GMT is set to GMT;
> > 
> > 2) comment out the halt | reboot command `hwclock --systohc'.
> 
> I disagree with #2.  It goes against the principle of least surprise to
> new users who don't understand that the system clock is kept seperate
> from the hardware clock.  It is not causing the warping -- the
> adjustment is.  For potato, I think #1 will be a reasonable solution.
> 

The principle of least surprise is a relative notion, not an absolute one :
a beginner will be far more surprised than a retailed sysadmin.
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.

So, for a basic user, there is only one clock : *the* clock ;) And this one
is the hardware clock, even if he doesn't actually know that. Problems will
occur if the machine hosts a unix system and a M$ one, and in this case we
can do the test of the $GMT value. The only "dangerous" moment, with a local
time, is the change of hour. The beginner will set the date with `date'...
and loose the change on reboot but *without* spoiling the date : there will 
be always one hour. So the problem will be easy to address.

Letting the instruction `hwclock --systohc' will spoil the hardware clock
because, without tuning, the system clock is less accurate than the
CMOS clock.

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
>                 #
>                 #       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
>                 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
> 

Cheers,
-- 
Thierry LARONDE
thierry.laronde@polynum.com
website : http://www.polynum.com


Reply to: