Re: What TZ do you use to get right time w/ clockspeed?
Malte Tancred <[email protected]> Tue, 26 Nov 2002 09:54:55 +0100
| Newsgroups | gmane.comp.lib.libtai |
|---|---|
| Message-ID | <[email protected]> |
Paul Jarc:
> ntpd expects the system clock to be POSIX, doesn't it? Or does it
> depend on the time zone setting? I think the times published by your
> ntpd are 22 seconds ahead of those published by other time servers.
I certainly hoped ntpd would honor the zone file setting. However,
it appears not to.
I forgot to run the the most obvious test, namely using sntpclock
from ntp.oops.se to ntpd on ntp.oops.se itself.
[ntp.oops.se:~] malte% l /etc/leapsecs.dat
-rw-r--r-- 1 root wheel 176 Feb 22 2002 /etc/leapsecs.dat
[ntp.oops.se:~] malte% l /etc/localtime
lrwxr-xr-x 1 root wheel 42 Nov 20 14:44 /etc/localtime ->
/usr/share/zoneinfo/right/Europe/Stockholm
[ntp.oops.se:~] malte% sntpclock 127.0.0.1 | clockview
before: 2002-11-26 09:12:26.159613000000000000
after: 2002-11-26 09:12:48.159591999793387949
On ntp.oops.se sntpclock is used to feed adjustments to clockspeed
so there's obviously a problem with how ntpd interprets the system
clock.
>> I noticed however that zoneinfo/Europe/Stockholm and
>> right/Europe/Stockholm is binary equivalent. I don't know
>> if this matters.
>
> Odd.
Forget that. I messed up when installing the zone files.
> So ntp.oops.se's system clock is 22 + the clock of ntp.utfors.se, but
> it's supposed to be that way, because ntp.utfors.se has a POSIX clock
> and ntp.oops.se has a TAI clock.
...
> ntpd as a client assumes that both the local and remote clocks are
> POSIX, and makes the client's clock hold the same value at the same
> time as the server's clock. So the client now has a TAI clock, since
> that's what the server has (even though ntpd doesn't know it).
You seem to be right of course. Another simple test that I just
performed - with right/ files installed on both our time server and
the client syncing using ntpd - seem to indicate this as well:
[ntp.oops.se:~] malte% date
Tue Nov 26 09:19:04 CET 2002
[client:~] malte% date
Tue Nov 26 09:19:04 CET 2002
So the problem, if it should be considered a problem, is that
publishing time using ntpd from a clockspeed enhanced server will
make clients' clocks into TAI clocks.
For this to be interpreted right by the clients, the clients need
to install the right/ zone files. The clients also should not try
to synchronize to another time server if that server does not
publish the TAI clock.
> For Bennett: if the client is an appliance and you can't install
> right/ zones, the client will be 22 seconds ahead. To fix that,
> you'll have to patch the server to remove leap seconds from the system
> clock to produce a publishable NTP time.
Or, if I've interpreted the documentation for the local reference
clock driver correctly, you should be able to use the "time1" fudge
variable. The documentation states that this variable can be used to
alter the clock by a specified number of seconds.
If this works you should be able to publish a POSIX clock without
patching the server.
(it didn't for me and I'm unsure whether this depends on the
version of ntpd that I'm using or if I've misunderstood the
purpose of the variable)
>> Is this an effect of the client not using the right/ zone files?
>
> Yes.
>
>> Why doesn't the client see the same difference to ntp.oops.se and
>> ntp.utfors.se?
>
> I'm guessing that you're misinterpreting the ntpdate output; see
> above. But maybe I'm wrong. Try installing and using the right/
> zones, and see what ntpdate says then.
I think I understand what's going on now. Thank you so much for your
help.
And, if the reasoning above is somehow messed up, I welcome any
further corrections and clarifications. :-)
Thanks again,
Malte