Re: What TZ do you use to get right time w/ clockspeed?

Malte Tancred <[email protected]> Fri, 15 Nov 2002 11:28:18 +0100
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
On thursday, nov 14, 2002, at 22:09 Europe/Stockholm, Bennett Todd 
wrote:
> Anybody know if it's possible to set up an ntp server that treats the 
> local system clock (e.g. maintained by clockspeed:-) as authoritative 
> and broadcasts that, for the benefit of ntp-only idiot boxes like 
> various appliances?

I've done it this way:

On the time server:

   1) Install and run clockspeed through daemontools

   2) Compile and use the right/ zone files (ie ln -s /usr/.../right/... 
/etc/localtime)

   3) Create an ntpd configuration for a local clock drive. Here's mine:

     # Configure ntpd with a local clock reference driver.
     # When run with this driver ntpd will not try to set
     # the system clock and will serve the machine's local
     # time to clients.
     #
     # The server address 127.127.1.x refers to the local
     # clock driver.

     server 127.127.1.1 prefer minpoll 4

4) run ntpd:
   /usr/sbin/ntpd -n -c 
/Library/StartupItems/NTPServer/ntpd_local_driver.conf &


I have a few problems with this setup. From another machine in our net
(habanero.oops.se) that's syncing against our clockserver (ntp.oops.se)
using ntpd:

    - copied sntpclock and clockview programs from ntp.oops.se.
    - installed a leapsecs.dat file.
    - _no_ right/ zones installed.

   [habanero:~] malte% ntpdate -q ntp.utfors.se
   server 0.0.0.0, stratum 0, offset 1694498816.000000, delay 0.89185
   server 193.180.255.232, stratum 4, offset -0.041481, delay 0.03578
   server 195.58.103.125, stratum 2, offset -22.037324, delay 0.04967
   15 Nov 11:11:02 ntpdate[9309]: step time server 0.0.0.0 offset 
1694498816.000000 sec

   [habanero:~] malte% sntpclock `dnsip ntp.oops.se` | clockview
   before: 2002-11-15 11:11:09.848713000000000000
   after:  2002-11-15 11:11:31.812008499933496117

   [habanero:~] malte% sntpclock `dnsip ntp.utfors.se` | clockview
   before: 2002-11-15 11:11:17.164666000000000000
   after:  2002-11-15 11:11:17.127152138427734375

So, on the client:

   ntpdate thinks
   1) the client is in sync with ntp.oops.se
   2) the client is 22 secs behind ntp.utfors.se

   sntpclock/clockview thinks
   1) the client is 22 secs behind ntp.oops.se
   2) the client is in sync with ntp.utfors.se

As I wrote, our server ntp.oops.se has the right/ zone files installed. 
I
noticed however that zoneinfo/Europe/Stockholm and 
right/Europe/Stockholm
is binary equivalent. I don't know if this matters.

The tests above was performed with /etc/localtime changed to
right/Etc/UTC. right/Etc/UTC differs from the stock zoneinfo/Etc/UTC.

The server use sntpclock to synchronize with ntp.utfors.se.
The client use ntpd to synchronize with ntp.oops.se.

Is this an effect of the client not using the right/ zone files?
Why doesn't the client see the same difference to ntp.oops.se and
ntp.utfors.se?

A bit confused,
Malte