On 2015-Jul-01 12:46:21 -0500, Leif Pedersen <bilbo at hobbiton.org> wrote:>Is there a reasonable way to enable awareness of leap-seconds while syncing >with ntpd? That is to say, how can I get the system to include leap-seconds >in calculating `date +%s`, without having `date` be off by 26[1] seconds?ntpd(8) has provision for specifying a leapsecond file which presumably makes it leap-second aware. I haven't looked into the details. There's also posix2time(3) to convert between a TAI-based time_t and a POSIX-based time_t. -- Peter Jeremy -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 949 bytes Desc: not available URL: <http://lists.freebsd.org/pipermail/freebsd-security/attachments/20150702/f53016ca/attachment.bin>
Peter Jeremy wrote this message on Thu, Jul 02, 2015 at 06:27 +1000:> On 2015-Jul-01 12:46:21 -0500, Leif Pedersen <bilbo at hobbiton.org> wrote: > >Is there a reasonable way to enable awareness of leap-seconds while syncing > >with ntpd? That is to say, how can I get the system to include leap-seconds > >in calculating `date +%s`, without having `date` be off by 26[1] seconds? > > ntpd(8) has provision for specifying a leapsecond file which presumably > makes it leap-second aware. I haven't looked into the details. > > There's also posix2time(3) to convert between a TAI-based time_t and a > POSIX-based time_t.Though from my reading of the code, you need to have TZ files compiled w/ leap seconds which FreeBSD doesn't do by default... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
On Wed, Jul 1, 2015 at 3:27 PM, Peter Jeremy <peter at rulingia.com> wrote:> > On 2015-Jul-01 12:46:21 -0500, Leif Pedersen <bilbo at hobbiton.org> wrote: > >Is there a reasonable way to enable awareness of leap-seconds whilesyncing> >with ntpd? That is to say, how can I get the system to includeleap-seconds> >in calculating `date +%s`, without having `date` be off by 26[1] seconds? > > ntpd(8) has provision for specifying a leapsecond file which presumably > makes it leap-second aware. I haven't looked into the details. >>From the docs, I'm fairly sure that the leap-second files don't stop NTPfrom fudging hardware clock, and only help it do so more gracefully.> There's also posix2time(3) to convert between a TAI-based time_t and a > POSIX-based time_t.posix2time(3) doesn't seem to have anything to do with setting the hardware clock.> > -- > Peter Jeremy-- As implied by email protocols, the information in this message is not confidential. Any middle-man or recipient may inspect, modify, copy, forward, reply to, delete, or filter email for any purpose unless said parties are otherwise obligated. As the sender, I acknowledge that I have a lower expectation of the control and privacy of this message than I would a post-card. Further, nothing in this message is legally binding without cryptographic evidence of its integrity. http://bilbo.hobbiton.org/wiki/Eat_My_Sig
<<On Thu, 2 Jul 2015 06:27:28 +1000, Peter Jeremy <peter at rulingia.com> said:> ntpd(8) has provision for specifying a leapsecond file which presumably > makes it leap-second aware. I haven't looked into the details.The current NTP protocol, as implemented by ntpd, distributes leap-second information if provided. This information may be provided by higher-stratum (upstream) NTP servers, or by using the "leapfile" configuration statement in ntp.conf to specify a local copy of the leapseconds file in NIST/USNO format. No such file is provided by default. We could easily do so, but shouldn't, because that file would take precedence over the leap indicator learned from higher-stratum servers, and that's not desirable for clients. If you're running a bunch of servers, you should distribute and install the leapseconds file using your configuration-management system. (For example, my puppet module for NTP, which we use at CSAIL for three NTP servers, does so: <https://github.com/gwollman/puppet-ntp>.) -GAWollman