* Wrong clock initialization
@ 2003-05-20 17:34 David Balazic
2003-05-20 18:08 ` David D. Hagood
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: David Balazic @ 2003-05-20 17:34 UTC (permalink / raw)
To: linux-kernel
Hi!
When the kernel is booted ( ia32 version at least ) , it reads
the time from from the hardware CMOS clock , _assumes_ it is in
UTC and set the system time to it.
As almost nobody runs their clock in UTC, this means that the system
is running on wrong time until some userspace tool corrects it.
This can lead to situtation when time goes backwards :
timezone is 2hours east of UTC.
UTC time : 20:00
local time : 22:00
System time between boot and userspace fix : 22:00UTC
System time after fix : 20:00UTC
Comments ?
--
David Balazic
--------------
"Be excellent to each other." - Bill S. Preston, Esq., & "Ted" Theodore
Logan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 17:34 Wrong clock initialization David Balazic
@ 2003-05-20 18:08 ` David D. Hagood
2003-05-20 18:10 ` george anzinger
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: David D. Hagood @ 2003-05-20 18:08 UTC (permalink / raw)
To: linux-kernel
David Balazic wrote:
> As almost nobody runs their clock in UTC, this means that the system
> is running on wrong time until some userspace tool corrects it.
I run my clocks in UTC - the MS approach of keeping the system clock in
local time (and having to change it twice a year, or when I'm
travelling, or....) is too much of a pain in the ass.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 17:34 Wrong clock initialization David Balazic
2003-05-20 18:08 ` David D. Hagood
@ 2003-05-20 18:10 ` george anzinger
2003-05-20 18:27 ` David Balazic
2003-05-20 18:17 ` Michael Buesch
` (3 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: george anzinger @ 2003-05-20 18:10 UTC (permalink / raw)
To: David Balazic; +Cc: linux-kernel
David Balazic wrote:
> Hi!
>
> When the kernel is booted ( ia32 version at least ) , it reads
> the time from from the hardware CMOS clock , _assumes_ it is in
> UTC and set the system time to it.
>
> As almost nobody runs their clock in UTC, this means that the system
> is running on wrong time until some userspace tool corrects it.
>
> This can lead to situtation when time goes backwards :
>
> timezone is 2hours east of UTC.
> UTC time : 20:00
> local time : 22:00
>
> System time between boot and userspace fix : 22:00UTC
> System time after fix : 20:00UTC
>
> Comments ?
During shut down my system "says" it is setting the CMOS clock from
the kernel clock. I would expect this to correct the problem. Is
this a distro thing?
In any case, this would seem to make the problem go away after the
first shutdown (if you don't dual boot with something other than Linux :).
>
>
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 17:34 Wrong clock initialization David Balazic
2003-05-20 18:08 ` David D. Hagood
2003-05-20 18:10 ` george anzinger
@ 2003-05-20 18:17 ` Michael Buesch
2003-05-20 18:26 ` David Balazic
2003-05-20 20:16 ` Jan Harkes
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Michael Buesch @ 2003-05-20 18:17 UTC (permalink / raw)
To: David Balazic; +Cc: linux kernel mailing list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 20 May 2003 19:34, David Balazic wrote:
> Hi!
>
> When the kernel is booted ( ia32 version at least ) , it reads
> the time from from the hardware CMOS clock , _assumes_ it is in
> UTC and set the system time to it.
>
> As almost nobody runs their clock in UTC, this means that the system
> is running on wrong time until some userspace tool corrects it.
>
> This can lead to situtation when time goes backwards :
>
> timezone is 2hours east of UTC.
> UTC time : 20:00
> local time : 22:00
>
> System time between boot and userspace fix : 22:00UTC
> System time after fix : 20:00UTC
>
> Comments ?
Why don't you simply set your CMOS clock to UTC?
- --
Regards Michael Büsch
http://www.8ung.at/tuxsoft
20:16:51 up 4:12, 2 users, load average: 1.00, 1.07, 1.24
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+ynFooxoigfggmSgRAopWAJ0YOxEJ5jA3sfNhDwbSHmM5Z2nJQACcDxad
+25XjbOyOGRKYUMtdQtv6mI=
=jE5A
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 18:17 ` Michael Buesch
@ 2003-05-20 18:26 ` David Balazic
0 siblings, 0 replies; 10+ messages in thread
From: David Balazic @ 2003-05-20 18:26 UTC (permalink / raw)
To: Michael Buesch; +Cc: linux kernel mailing list
Michael Buesch wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tuesday 20 May 2003 19:34, David Balazic wrote:
> > Hi!
> >
> > When the kernel is booted ( ia32 version at least ) , it reads
> > the time from from the hardware CMOS clock , _assumes_ it is in
> > UTC and set the system time to it.
> >
> > As almost nobody runs their clock in UTC, this means that the system
> > is running on wrong time until some userspace tool corrects it.
> >
> > This can lead to situtation when time goes backwards :
> >
> > timezone is 2hours east of UTC.
> > UTC time : 20:00
> > local time : 22:00
> >
> > System time between boot and userspace fix : 22:00UTC
> > System time after fix : 20:00UTC
> >
> > Comments ?
>
> Why don't you simply set your CMOS clock to UTC?
Because certain other operating systems that expect localtime
would then have problems.
--------------
"Be excellent to each other." - Bill S. Preston, Esq., & "Ted" Theodore
Logan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 18:10 ` george anzinger
@ 2003-05-20 18:27 ` David Balazic
2003-05-20 20:21 ` george anzinger
0 siblings, 1 reply; 10+ messages in thread
From: David Balazic @ 2003-05-20 18:27 UTC (permalink / raw)
To: george anzinger; +Cc: linux-kernel
george anzinger wrote:
>
> David Balazic wrote:
> > Hi!
> >
> > When the kernel is booted ( ia32 version at least ) , it reads
> > the time from from the hardware CMOS clock , _assumes_ it is in
> > UTC and set the system time to it.
> >
> > As almost nobody runs their clock in UTC, this means that the system
> > is running on wrong time until some userspace tool corrects it.
> >
> > This can lead to situtation when time goes backwards :
> >
> > timezone is 2hours east of UTC.
> > UTC time : 20:00
> > local time : 22:00
> >
> > System time between boot and userspace fix : 22:00UTC
> > System time after fix : 20:00UTC
> >
> > Comments ?
>
> During shut down my system "says" it is setting the CMOS clock from
> the kernel clock. I would expect this to correct the problem. Is
> this a distro thing?
The time is properly converted first to be localtime, if your CMOS
is localtime. So this does not fix anything.
>
> In any case, this would seem to make the problem go away after the
> first shutdown (if you don't dual boot with something other than Linux :).
--
David Balazic
--------------
"Be excellent to each other." - Bill S. Preston, Esq., & "Ted" Theodore
Logan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 17:34 Wrong clock initialization David Balazic
` (2 preceding siblings ...)
2003-05-20 18:17 ` Michael Buesch
@ 2003-05-20 20:16 ` Jan Harkes
2003-05-21 11:38 ` Jesse Pollard
2003-05-21 17:00 ` Jerry Cooperstein
5 siblings, 0 replies; 10+ messages in thread
From: Jan Harkes @ 2003-05-20 20:16 UTC (permalink / raw)
To: David Balazic; +Cc: linux-kernel
On Tue, May 20, 2003 at 07:34:55PM +0200, David Balazic wrote:
> As almost nobody runs their clock in UTC, this means that the system
> is running on wrong time until some userspace tool corrects it.
I thought everybody used the CMOS clock in UTC, which means that the
kernel doesn't have to know anything about nasty little details related
to timezones, daylight savings time and such. Localtime is just a
presentation issue.
> This can lead to situtation when time goes backwards :
>
> timezone is 2hours east of UTC.
> UTC time : 20:00
> local time : 22:00
>
> System time between boot and userspace fix : 22:00UTC
> System time after fix : 20:00UTC
>
> Comments ?
All your disks are typically still mounted readonly and no important
applications are running except for perhaps an fsck /dev/root between
the time the system is booted and the clock is fixed up. So it really
doesn't matter whether your clock is off by a couple of hours for a
couple of seconds (a minute?) during boot.
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 18:27 ` David Balazic
@ 2003-05-20 20:21 ` george anzinger
0 siblings, 0 replies; 10+ messages in thread
From: george anzinger @ 2003-05-20 20:21 UTC (permalink / raw)
To: David Balazic; +Cc: linux-kernel
David Balazic wrote:
> george anzinger wrote:
>
>>David Balazic wrote:
>>
>>>Hi!
>>>
>>>When the kernel is booted ( ia32 version at least ) , it reads
>>>the time from from the hardware CMOS clock , _assumes_ it is in
>>>UTC and set the system time to it.
>>>
>>>As almost nobody runs their clock in UTC, this means that the system
>>>is running on wrong time until some userspace tool corrects it.
>>>
>>>This can lead to situtation when time goes backwards :
>>>
>>>timezone is 2hours east of UTC.
>>>UTC time : 20:00
>>>local time : 22:00
>>>
>>>System time between boot and userspace fix : 22:00UTC
>>>System time after fix : 20:00UTC
>>>
>>>Comments ?
>>
>>During shut down my system "says" it is setting the CMOS clock from
>>the kernel clock. I would expect this to correct the problem. Is
>>this a distro thing?
>
>
> The time is properly converted first to be localtime, if your CMOS
> is localtime. So this does not fix anything.
Ouch! That is a real disconnect. Time to fix something.
>
>
>>In any case, this would seem to make the problem go away after the
>>first shutdown (if you don't dual boot with something other than Linux :).
>
>
>
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 17:34 Wrong clock initialization David Balazic
` (3 preceding siblings ...)
2003-05-20 20:16 ` Jan Harkes
@ 2003-05-21 11:38 ` Jesse Pollard
2003-05-21 17:00 ` Jerry Cooperstein
5 siblings, 0 replies; 10+ messages in thread
From: Jesse Pollard @ 2003-05-21 11:38 UTC (permalink / raw)
To: David Balazic, linux-kernel
On Tuesday 20 May 2003 12:34, David Balazic wrote:
> Hi!
>
> When the kernel is booted ( ia32 version at least ) , it reads
> the time from from the hardware CMOS clock , _assumes_ it is in
> UTC and set the system time to it.
>
> As almost nobody runs their clock in UTC, this means that the system
> is running on wrong time until some userspace tool corrects it.
>
> This can lead to situtation when time goes backwards :
>
> timezone is 2hours east of UTC.
> UTC time : 20:00
> local time : 22:00
>
> System time between boot and userspace fix : 22:00UTC
> System time after fix : 20:00UTC
>
> Comments ?
I strongly recommend running in UTC.
1. the system can then move between time zones without additional complexity
2. conversion errors during localtime -> system time don't occur
3. your clock doesn't get blown during system->localtime during shutdown
(assuming you save system time...)
4. if you operate in a daylight saving time area, you won't get your clock
blowin by variations in time depending on when you reboot.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Wrong clock initialization
2003-05-20 17:34 Wrong clock initialization David Balazic
` (4 preceding siblings ...)
2003-05-21 11:38 ` Jesse Pollard
@ 2003-05-21 17:00 ` Jerry Cooperstein
5 siblings, 0 replies; 10+ messages in thread
From: Jerry Cooperstein @ 2003-05-21 17:00 UTC (permalink / raw)
To: David Balazic; +Cc: linux-kernel
This is not directly a kernel problem. I developed this after
a glibc upgrade. The problem is most distros (such as redhat)
make a symbolic link
/etc/localtime -> /usr/share/zoneinfo/America/Los_Angeles
or whatever your timezone is. On some of my systems, /usr/share is on
a disk partition that is not mounted at the time the link is needed
during initialization; the system then defaults to UTC. As a result,
each time you boot up your system loses a time equal to the difference
between UTC and your local time zone.
To fix this, just make sure /etc/localtime is actually a file on the
root filesystem, not a link to a possibly unmounted filesystem.
Just copy the one pointed to by the link.
I have systems with the same partition/mount layout which have no
problem, so I don't know why some systems get confused. So far I
have only seen this on laptops.
======================================================================
Jerry Cooperstein, Senior Consultant, <coop@axian.com>
Axian, Inc., Software Consulting and Training
4800 SW Griffith Dr., Ste. 202, Beaverton, OR 97005 USA
http://www.axian.com/
======================================================================
On Tue, May 20, 2003 at 07:34:55PM +0200, David Balazic wrote:
> Hi!
>
> When the kernel is booted ( ia32 version at least ) , it reads
> the time from from the hardware CMOS clock , _assumes_ it is in
> UTC and set the system time to it.
>
> As almost nobody runs their clock in UTC, this means that the system
> is running on wrong time until some userspace tool corrects it.
>
> This can lead to situtation when time goes backwards :
>
> timezone is 2hours east of UTC.
> UTC time : 20:00
> local time : 22:00
>
> System time between boot and userspace fix : 22:00UTC
> System time after fix : 20:00UTC
>
> Comments ?
>
>
> --
> David Balazic
> --------------
> "Be excellent to each other." - Bill S. Preston, Esq., & "Ted" Theodore
> Logan
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - -
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-05-21 16:47 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-20 17:34 Wrong clock initialization David Balazic
2003-05-20 18:08 ` David D. Hagood
2003-05-20 18:10 ` george anzinger
2003-05-20 18:27 ` David Balazic
2003-05-20 20:21 ` george anzinger
2003-05-20 18:17 ` Michael Buesch
2003-05-20 18:26 ` David Balazic
2003-05-20 20:16 ` Jan Harkes
2003-05-21 11:38 ` Jesse Pollard
2003-05-21 17:00 ` Jerry Cooperstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox