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

Re: Scary bugs



On Sun, Jan 30, 2000 at 12:18:11AM +0100, Thierry Laronde wrote:
> On Sat, Jan 29, 2000 at 01:14:06PM -0800, Ryan Murray wrote:
> [..]
> > 
> > As has been pointed out, we don't know that the user is ONLY using
> > hwclock to adjust their clock.  Most new-to-Linux users won't know that
> > hwclock is where all changes are supposed to happen.
> 
> We all know that the main point is a lack of documentation. But, as I
> wrote in a previous mail, the problem at the moment is for potato
> to have a "reasonable" default. We can't make a good solution at the
> moment, the problem seems "simple" but is, actually, complex.
> 
> 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.

For woody, we could look into making the adjustment mechanism smarter
and then re-enabling it.

As a continuation of #1, I think the start action for hwclock.sh should
be skipped if $GMT is set to GMT.  If your HW clock is GMT, then the
kernel does not need a time update, which might interfere with NTP.

So it would end up something like this:

case "$1" in
        start)
                if [ ! -f /etc/adjtime ]
                then
                        echo "0.0 0 0.0" > /etc/adjtime
                fi
                # hwclock --adjust $GMT
                [ "$GMT" = "--utc" ] && hwclock --hctosys
                #
                #       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 updated to `date`."
                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: