[ntp:questions] Failed to test leapsecond's handling

Marco Marongiu brontolinux at gmail.com
Thu Mar 8 12:10:02 UTC 2012


Hi all

I finally arranged a box to test how the leap second is managed, but not
sure I got it right, as basically nothing seems to be happening. Can you
help me to understand what I am doing wrong?

Configuration and test files are included at the end of this message.

I installed a Dell Optiplex 745 with Debian Squeeze, updated with the
latest security patches.

I then tried to set up things as planned, also following Martin Burnicki
suggestions (see his message to this list at http://tinyurl.com/75dtnhk).

After some fruitless attempts to set up the node in orphan mode, I
decided to sync it with its own local clock.

I succeed arming a leap second with the combination: move clock to June
30th + sync to local clock + use leap seconds file. Watching the output
of "ntpq -c pe -c rv", I correctly see the leap_add_sec and the
leap_armed bits set before the leap second happens, and leap_none and
leap_event set afterwards.

But when I graph the time log (see the log target in the makefile), I
don't see the leap second kicking in. Based on Mills' "The NTP Timescale
and Leap Seconds"[1], when the leap second kicks in, I'd expect two
consecutive date command to _appear_ happen at different offset than in
normal conditions. Unfortunately, that didn't happen, and if I draw a
line of the accumulated offsets between consecutive runs of the command,
the line is almost perfectly straight.

What am I doing wrong?

thanks in advance
-- bronto

[1] http://www.eecis.udel.edu/~mills/leap.html


---8<--- Makefile ---8<------8<------8<------8<------8<------8<---
nothing:
	@echo "...and nothing I'll make."

leapset: stopntpd armleap startntpd

reset: stopntpd resetclock resetconf startntpd

test: stopntpd june30 localconf startntpd

armleap:
	adjtimex -S 17

stopntpd:
	/etc/init.d/ntp stop

startntpd:
	/etc/init.d/ntp start

restartntpd:
	/etc/init.d/ntp restart

resetclock:
	ntpdate 0.debian.pool.ntp.org

resetconf: ntp.conf.dist
	cp ntp.conf.dist /etc/ntp.conf

localconf: ntp.conf.local
	cp ntp.conf.local /etc/ntp.conf

june30:
	date --set="2012-06-30 23:59:45"

log:
	> time.log
	while true ; do date "+%Y/%m/%d %H:%M:%S.%N" ; done |\
	  tee time.log

---8<------8<------8<------8<------8<------8<------8<------8<------8<---

You run "make test" to test the leap second, "make log" to log dates and
times, and "make reset" to reset the clock to the current time and date.


---8<--- ntp.conf.dist ---8<------8<------8<------8<------8<------8<---
driftfile /var/lib/ntp/ntp.drift

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

restrict 127.0.0.1
restrict ::1
---8<------8<------8<------8<------8<------8<------8<------8<------8<---


---8<--- ntp.conf.local ---8<------8<------8<------8<------8<------8<---
driftfile /var/lib/ntp/ntp.drift

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

server 127.127.1.0
fudge 127.127.1.0 stratum 10

leapfile "/etc/leap-seconds"

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

restrict 127.0.0.1
restrict ::1
---8<------8<------8<------8<------8<------8<------8<------8<------8<---

An excerpt of the time log for 23:59:59.00 - 00:00:01.00 can be found at
http://pastebin.com/GjgiFZ68


More information about the questions mailing list