Re: Is 'right' wrong? (was: clockspeed and system time)

Lloyd Zusman <[email protected]> Sat, 22 Jan 2005 11:30:38 -0500
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
Well, after much head-spinning, I think I now understand this better.

The reason that I saw the discrepancy between 'before' and 'after' in
the first email message, below, is because I had forgotten to do this
after changing the /etc/localtime and /etc/leapsecs.dat files:

  sntpclock 209.51.161.238 >/usr/local/clockspeed/adjust

After doing this and re-running the tests, these 'before' and 'after'
values are now in sync.

And I think I now better understand the use of the right/ timezones, as
well:

Scenario 1:

  using clockspeed
  using /etc/leapsecs.dat
  using right/ timezone descriptors

  Result: clock is set to TAI (based on Date: field in emails),
          and dates/times display as UTC in the
          'date' and 'sntpclock' commands

Scenario 2:

  using clockspeed
  using /etc/leapsecs.dat
  not using right/ timezone descriptors

  Result: clock is set to TAI (based on Date: field in emails),
          and dates/times display as TAI in the
          'date' and 'sntpclock' commands

In other words, the use of a right/ timezone descriptor causes a system
with a TAI-based system clock to display the time based on UTC.

Here are some more cases:

Scenario 3:

  using clockspeed
  not using /etc/leapsecs.dat
  not using right/ timezone descriptors

  Result: clock is set to UTC (based on Date: field
          in emails), and dates/times display as UTC
          with the 'date' and 'sntpclock' commands

Scenario 4:

  using clockspeed
  not using /etc/leapsecs.dat
  using right/ timezone descriptors

  Result: clock is set to UTC (based on Date: field in emails),
          and dates/times display as UTC - 22 seconds in the
          'date' and 'sntpclock' commands

So ... it seems to be that when using clockspeed, /etc/leapsecs.dat
affects the system clock, and (in all cases, not just with clockspeed)
the right/ timezone descriptor affects the offset from the system clock
that is applied by various system utilities like 'date'.

The use of /etc/leapsecs.dat currently adds 22 seconds to the system
clock; and right/ timezone descriptors currently subtract 22 seconds
from the date/time value that would be displayed by various system
utilities.

What I want is for my system clock to be set to TAI, and for 'date',
etc., to also display that same time value.  Hence, Scenario 2 is for
me.


Lloyd Zusman <[email protected]> writes:

> Starting with my system exactly as specified in my quoted message below,
> I then changed the /etc/localtime symbolic link:
>
>   before: /usr/share/zoneinfo/America/New_York
>   after:  /usr/share/zoneinfo/right/America/New_York
>
> Now that I am using the 'right' stuff, I get the 22-second discrepancy.
> I ran the sntpclock/clockview/date/mail test as specificed below, and
> this is the email I received:
>
>   To: [email protected]
>   Subject: x
>   From: [email protected]
>   Delivered-To: [email protected]
>   Message-Id: <[email protected]>
>   Date: Fri, 21 Jan 2005 19:40:56 -0500 (EST)
>
>
>   before: 2005-01-21 19:40:56.932327000000000000
>   after:  2005-01-21 19:41:18.404562499907009303
>   Fri Jan 21 19:40:56 EST 2005
>
> In other words, there was no discrepancy before I used the 'right'
> version, but with it, the above discrepancy exists.
>
> Every time I run this test, the same discrepancy shows up between
> the "before" and "after" values.
>
> So, it looks like 'right' is wrong, but I don't believe it.
>
> Therefore, I temporarily removed /etc/leapsecs.dat and tried again.
> Here's what I got:
>
>   To: [email protected]
>   Subject: x
>   From: [email protected]
>   Delivered-To: [email protected]
>   Message-Id: <[email protected]>
>   Date: Fri, 21 Jan 2005 19:51:00 -0500 (EST)
>
>   before: 2005-01-21 19:51:00.126582000000000000
>   after:  2005-01-21 19:50:59.599616999776452779
>   Fri Jan 21 19:51:00 EST 2005
>
> In other words, everything is back in sync again.
>
> Therefore, I believe that it is _not_ correct to use _both_
> /etc/leapsecs.dat _and_ 'right' timezone info.  In other words, use one
> or the other, but not both.
>
> Is this correct?  If so, which is preferred, /etc/leapsecs.dat or
> the 'right' timezone info?
>
> Thanks in advance.
>
>
>> Thanks for this explanation.
>>
>> However, I _do_ have /etc/leapsecs.dat.  In other words, here's my
>> situation:
>>
>> - I have /etc/leapsecs.dat
>>
>> - My /etc/localtime is /usr/share/zoneinfo/America/New_York
>>
>> - My "TZ" environment variable is not set
>>
>> - I run clockspeed-0.62, compiled in the standard, "out of the box" way
>>
>> - All times, including the one in the "Date:" header, are consistent
>>   in the email I receive when I run the following command (in other
>>   words, no 22 second discrepancy between one another):
>>   (sntpclock 209.51.161.238 | clockview; date) | mail -s x [email protected]
>>
>> - This is the same on two systems that I run: freebsd-4.0 and
>>   linux-2.6.10-1.741_FC3smp
>>
>> Why is there no 22 second discrepancy among any of the time values that
>> got generated?  And all of these are correctly showing TAI.
>>
>> I need to run, but I'll change over to a right/ timezone a little later
>> today and see what happens.
>>
>>
>> -- 
>>  Lloyd Zusman
>>  [email protected]
>>  God bless you.
>>
>>
>
> -- 
>  Lloyd Zusman
>  [email protected]
>  God bless you.
>
>

-- 
 Lloyd Zusman
 [email protected]
 God bless you.