Re: hwclock problem with leapseconds - posix?



ibuprofin@xxxxxxxxxxxxxxxxxxxxxx (Moe Trin) writes:

On Tue, 1 Jan 2008, in the Usenet newsgroup comp.os.linux.setup, in article
<7321c5fa-4933-423d-99cb-fe0d71aef9ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
cc-tec@xxxxxx wrote:

NOTE: Posting from groups.google.com (or some web-forums) dramatically
reduces the chance of your post being seen. Find a real news server.

in my particular case i'd like to have accurate timestamps for the
boot phase too

What distribution? Most systems set the "software" clock in the
first boot script. Assuming your system uses /etc/inittab (most do),
look at the 'System initialization' script

He claims that he has problems on bootup that the hwclock --rtctosys does
not work properly, and introduces hiw 23 sec out.
Mind you since the hardware clock will drift by few sec per hour anyway,
this seems pretty pointless worry, but lets accept his worry.


and cannot guarantee alltime ntp access, i'd dislike to have the time
22 seconds off per default when ntp does not work instantly after reboot,

I've no idea where you are finding a 22 second difference, as the current
difference between UTC and TAI is 33 seconds (see

Linux time I believe has 1970 as the reference time, and there are 23
leapseconds between then and now.



....

for me it looks like a problem with leapseconds, not a problem of
leapseconds, just a problem how systems deal with them, in this
particular case that hwclock is dealing differently for the --systohc
and the --hctosys functionality,

I'm not sure why you are having a problem, as running hwclock with
those two options does not introduce a _difference_ in the times.

He claims that IF he uses the djb extentions which use a different set of
tzdata zoninfo files which take into account leap seconds that then hwclock
going one way and then the other gives a 23 sec mismatch.

Ie, his system and rtc is on munged atomic time ( with Jan1 0:0:0 as the
epoch) and somehow the 22 or 23 saec is coming in there.

He has gotten convinced by djb that everyone else in the world does things
wrongly and badly, and wants to have his system on Bernstein time, rather
than UTC with the zoneinfo files translating from Bernstein time to UTC.




[trashbox7 /]# /sbin/hwclock --show ; /bin/date
Wed Jan 2 12:34:52 2008 -0.205553 seconds
Wed Jan 2 12:34:52 MST 2008
[trashbox7 /]# /sbin/hwclock --systohc
[trashbox7 /]# /sbin/hwclock --show ; /bin/date
Wed Jan 2 12:35:01 2008 -0.194958 seconds
Wed Jan 2 12:35:01 MST 2008
[trashbox7 /]# /sbin/hwclock --hctosys
[trashbox7 /]# /sbin/hwclock --show ; /bin/date
Wed Jan 2 12:35:09 2008 -0.280010 seconds
Wed Jan 2 12:35:09 MST 2008

Well yours is obvioulsy out by 8 sec. See hwclock to hc is at 12:35:01 and
when you read it back it is at 12:35:09 :-)

Anyway his argument is the problem occurs only if he is one munged tia, not
utc.


[trashbox7 /]

Here, the RTC in trashbox7 is set to localtime (DST isn't used here).
What timezone are you using in the system (what does the shell variable
TZ return, or what does /etc/localtime point to, or if all else fails,
what does '/bin/date ; /bin/date -u' show)?

Old guy
.



Relevant Pages

  • Re: hwclock problem with leapseconds - posix?
    ... hwclock, then you have a bug in hwclock, a bug which djb should fix. ... hwclock does not handle leapseconds the same way on writing to rtc as ... system uses utc, then no use of zoneinfo should be done. ...
    (comp.os.linux.setup)
  • Re: ntpdate foibles?
    ... placed two (three with daylight time) hours fast. ... It does not matter if the hwclock is set utc or local. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: daylight savings / time zone issue
    ... hwclock be set to UTC, which in my case would be 6 hours difference? ... Can I change my hardware clock to UTC via the linux command line? ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • changing hwclocks timezone
    ... I have a friend whose time is being reported incorrectly with the date command ... Both commands are reporting the commands in UTC ... The output of the date and hwclock commands: ... I didn't have him check the bios to see what the time is reporting there. ...
    (Debian-User)