Re: What TZ do you use to get right time w/ clockspeed?
Bennett Todd <[email protected]> Thu, 14 Nov 2002 16:09:25 -0500
| Newsgroups | gmane.comp.lib.libtai |
|---|---|
| Message-ID | <[email protected]> |
I _Think_, if I've correctly understood what everyone has said so far, that there are two ways you can run clockspeed. You can run with your clock advancing one second each second, without fail, for all that moral goodness and consistency, and the joy of standing up and calling POSIX a broken standard:-). To live consistently in that world and have date(1) report time that's consistent with other sources like e.g. GPS receivers or whatever, you should make sure you've got a good leapsecs.dat in place (honored by djb's libtai and by clockspeed), and for everything else (localtime(3), and all the rest of your Unix) you set your timezone to right/$TZ, copying files into /etc/localtime (and every chroot tree that's got a copy of that), etc. If your distrib doesn't have right/, maybe it calls it something else. If not you can pull the tzcode and tzdata from elsie (linked off djb's time.html page), and rebuild the zoneinfo you need. Since this approach is tilting at POSIX, it may possibly break other things. You'd certainly have to implement it consistently across all platforms you want to have consistent time. 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 really want to try and do this comprehensively, but if I can't keep POSIX time_t outside my perimeter, and have to maintain a hash of clocks running 22 seconds apart on different boxes throughout my facility, I might just give up, and take...: The other approach, according to Greg Black, and I just tested and it also seems to work, is to leave your TZ alone, as provided by the vendor, POSIXly busted, and remove leapsecs.dat, which will reset clockspeed to be blind to leap seconds, which seems to leave it operating consistently then with POSIX. I haven't tested this a lot, but a quick try indicates that it works. -Bennett
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE91BEFHZWg9mCTffwRAok4AKCsmgscrgmqRCyztpqxnQ4EVSCt+ACgzZXS L5oTuLdEhfYcofpmJJbvm1Y= =G2cr -----END PGP SIGNATURE-----