Re: Timezone wrong


Subject: Re: Timezone wrong
From: John M. Wright (jmw@chem.ucsd.edu)
Date: Thu Sep 06 2001 - 02:17:58 MDT


I had the same problem with time being set incorrectly when YDL2.0
started up. Apparently, the hardware clock kept by MacOS is in
local time, _not_ UTC; however, when YDL 2.0 started up, the time
was set as if it were stored in UTC, even though I specified that
time was stored as local time.

I noticed the following timestamp weirdness in /var/log/messages at
startup:

Sep 5 23:47:19 dt052nca rc.sysinit: Checking filesystems succeeded
Sep 5 16:47:24 dt052nca rc.sysinit: Mounting local filesystems: succeeded
Sep 5 16:47:24 dt052nca rc.sysinit: Turning on user and group quotas for local
filesystems: succeeded
Sep 5 16:47:24 dt052nca rc.sysinit: Enabling swap space: succeeded
Sep 5 23:47:25 dt052nca sysctl: dev.mac_hid.mouse_button_emulation = 1
Sep 5 16:47:25 dt052nca rc.sysinit: Enabling mouse button emulation: succeeded
Sep 5 23:47:25 dt052nca sysctl: dev.mac_hid.mouse_button2_keycode = 87
Sep 5 16:47:25 dt052nca rc.sysinit: Configuring mouse emulation button 2: succeeded
Sep 5 23:47:25 dt052nca sysctl: dev.mac_hid.mouse_button3_keycode = 88
Sep 5 16:47:25 dt052nca rc.sysinit: Configuring mouse emulation button 3: succeeded
Sep 5 23:47:26 dt052nca init: Entering runlevel: 3

The 23:47 time is correct; all the entries have the correct time
up to "Checking filesystems succeeded", and then it starts switching
back and forth between correct and as-if UTC times. With the original
YDL2.0 rc.sysinit file, it settled down at the wrong time. I decided
to insert an extra call to hwclock at the end of rc.sysint, so inserted
the folowing just before the final "wait" at the end of rc.sysinit:

/sbin/hwclock $CLOCKFLAGS

That caused it to settle down with the correct time; I suspect that
this does much the same as extracting the timesetting part of rc.sysinit
and running it from rc.local.

It would be nice to have a "real" fix, ie understand what is happening.

John Wright

Down with HTML'ized email!

> Date: Tue, 4 Sep 2001 23:21:47 -0700 (PDT)
> From: "Paul J. Lucas" <pauljlucas@mac.com>
> To: yellowdog-general@lists.yellowdoglinux.com
> Subject: Timezone wrong
>
> On Tue Jun 12 2001, Robert Story <rstory-l@revelstone.com> wrote:
>
> > I can't seem to get my clock set properly in YDL 2.0. When rc.sysinit does
> > it's thing at boot time, it correctly reads the local time from the
> > hardware clock, and calls settimeofday (info gleaned by adding --debug to
> > the default starting arguments), but doesn't have the timezone info set
> > correcty for some reason (tz argument is 0).
> >
> > If I extract the rc.sysint stuff into a separate file (rc.clock) and call
> > it from rc.local, the time is set correctly (settimeofday tz offset is 300,
> > not zero). Why doesn't rc.sysint work correctly?
>
> I've got the same problem. /etc/rc.sysinit doesn't bother to
> do anything with the ZONE variable defined in /etc/sysconfig/clock
> so in rc.sysinit, I inserted:
>
> TZ="$ZONE"; export TZ
>
> to be line 102 right before:
>
> /sbin/hwclock $CLOCKFLAGS
>
> and this fixes it. However, I just check the scripts and files
> in my old YDL 1.1 installation and they don't look at ZONE or TZ
> either, so it's not clear how YDL 1.1 got it right but 2.0 gets
> it wrong.
>
> - Paul
>
> Date: Wed, 5 Sep 2001 13:47:31 -0700 (PDT)
> From: "Paul J. Lucas" <pauljlucas@mac.com>
> To: yellowdog-general@lists.yellowdoglinux.com
> Subject: Re: Timezone wrong
>
> On Tue, 4 Sep 2001, Paul J. Lucas wrote:
>
> > I've got the same problem. /etc/rc.sysinit doesn't bother to
> > do anything with the ZONE variable defined in /etc/sysconfig/clock
> > so in rc.sysinit, I inserted:
> >
> > TZ="$ZONE"; export TZ
> >
> > to be line 102 right before:
> >
> > /sbin/hwclock $CLOCKFLAGS
> >
> > and this fixes it.
>
> I take it back. Even though it says it sets the time to the
> correct time in US/Pacific, the time is *still* in UTC.
>
> Anybody know of a real fix?
>
> - Paul
>



This archive was generated by hypermail 2a24 : Thu Sep 06 2001 - 01:25:57 MDT