NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: number of seconds since the epoch



 > I don't see any logic in the ntpd, though, to update the leap seconds
 > file from the NTP server, and it appears to ignore any leap second
 > tables from NTP servers for which it has no public key.  Is there a
 > good way to make this automatic?  I presume time.nist.gov will at
 > least have the leap second table -- does it also have a key pair?

    AFAIK, ntp doesn't maintain the file on its own.  It's a trivial
ftp fetch to script; see what I use from cron attached.

    You can get the tai offset and leapsecond file version with
"ntpq -c rv", which is surprisingly lacking in the right bits when
querying time.nist.gov.  However, nist does firmly state that they
support ntp crypto associations given some hoop jumping:
http://www.nist.gov/pml/div688/grp40/auth-ntp.cfm

    I absolutely can't speak for ntp's ability to transfer anything
past a leap second warning; it not something I've tried previously.  I
did just setup a client in symmetric key mode for giggles, and as yet
it shows no sign of picking up the tai offset.  Maybe autokey is
different.

 > (I suppose such questions are better asked on an NTP mailing list.)

    Quite possibly.  Hope this doesn't turn into a rathole compared to
kre's suggestion.

#!/bin/sh
# Fetch a new leap seconds file from nist.

set -e

cd /etc/ntp

ftp -V -o leap-seconds.list.$$ ftp://time.nist.gov/pub/leap-seconds.list

mv leap-seconds.list leap-seconds.list.old
mv leap-seconds.list.$$ leap-seconds.list


Home | Main Index | Thread Index | Old Index