Monthly ArchiveDecember 2008
Computers admin on 31 Dec 2008
Happy Leap Second!
I’m going to attempt to capture video of the wily Leap Second later this afternoon (Midnight UTC, which is in about 7 1/2 hours).
I’m hoping that my Mac will show a 60th second or at least bounce back forward a second. I’m prepping Snapz Pro X and a shell script for the momentous… moment.
Update: Victory!
I was expecting to admit defeat this morning but I checked the log on my other Mac and found this:
$ grep -A 3 59:58 logging.txt
--
Thu Jan 1 13:59:58 UTC 2009
Thu Jan 1 13:59:59 UTC 2009
Thu Jan 1 14:00:00 UTC 2009
Thu Jan 1 14:00:01 UTC 2009
--
Thu Jan 1 14:59:58 UTC 2009
Thu Jan 1 14:59:59 UTC 2009
Thu Jan 1 15:00:01 UTC 2009
Thu Jan 1 15:00:02 UTC 2009
At 9 a.m. local time, 3 p.m. UTC, the seconds jumped from 59 to 01 — and no, I didn’t just hack a line out of the log file.
I made some video captures of the Date & Time preference pane (nee control panel) yesterday but they were for naught. I tried Midnight UTC and Midnight CST but no dice.
I only caught the transition because I have a shell script logging time every hour on two different machines. My Mac Pro slept from 1:30 a.m. ’til 7:30 a.m. so I don’t know if it was supposed to jump ahead somewhere in that range. My MacBook Pro appeared to be in sync with the other Mac when I checked at 9:25 a.m. (I woke it up at 9:19 a.m.), but at 9:32 a.m. I got a +0.905406 second time adjustment. That is most likely the accumulated drift while it was sleeping for 8 hours, however. I don’t see any system.log entries on either machine that specifically mention a leap second… perhaps I’ll try it with debugging turned on in ntpd next time. (quell excitement)
For the intrepid non-programmers among you, here is a script:
#!/bin/sh
sleep 45
for i in {1..30}
do
date -u >> $HOME/logging.txt
sleep 1
done
Run that in cron at 59 past the hour to get a 30-second window around the hourly transitions. i.e.:
59 * * * * $HOME/timelog.sh
The trickiest part about this whole thing was actually getting “cron” going on my Mac running Leopard. Everything runs in launchd nowadays. I tried running the script that way first (use Lingon) but it was running at the wrong interval for some reason. I had to manually create a crontab file at /usr/lib/cron/tabs/<username> so “cron” would start (via launchd, of course).
In the end, barely worth the effort, but I captured the wily Leap Second. And they all said I was crazy…