BeigeJournal

2004-04-12 03:05 UTC

/computer

Network Time Protocol with Chrony

If you have a computer that is attached, even sporadically, to the Internet, you probably ought to be keeping the clock set accurately by Network Time Protocol, and if you use Unix Chrony is probably the program you want to use. It is a lot smaller and easier to configure than the full reference ntpd implementation, and is specifically designed to work well with intermittent network connections, like those of us still using dialup ppp access have, and which I suppose also applies in this new-fangled world of notebook computers and wireless networking.

I should note that Linux users upgrading to a 2.6 kernel from 2.4 need chrony 1.20. My old 1.19 stopped working, with a helpful error message in /var/log/messages, when I did the kernel upgrade.

Network time protocol (NTP) is a very carefully designed protocol for synchronizing computer clocks over a network. The idea is that time servers equipped with accurate time inputs, perhaps from WWVB or GPS receivers, provide NTP services to keep other computers synchronized. Your ISP ought to be running an NTP server, although, like many things ISPs ought to do, they may not be doing so.

Computer clocks are notoriously inaccurate. Although the cheap oscillators they use drift about in frequency with changes in temperature or lunar phase or whatever to a fairly large degree, the biggest error is the offset between the nominal frequency and the actual range of frequencies your particular oscillator runs at. The timekeeping error, thus, can be greatly reduced by measuring the actual frequency and using that in the timekeeping calculations. Chrony will use the time data it gathers to do so automatically. In principle, you can make clock error measurements by hand and manually tweak the kernel timekeeping parameters, but no one is a big enough geek to do that. I thought about doing it once, but decided it wasn’t worth the effort.

Chrony works well with dialup Internet access. The chronyc program controls the chronyd daemon, and something like this:

/usr/local/bin/chronyc << EOF
password password
online
EOF

in a script run when the connection is brought up (RedHat users, and probably others, should be thinking /etc/ppp/ip-up.local), and an “offline” command when the connection is dropped, will start and stop network accesses by chronyd.

About

BeigeJournal

by Michael Pereckas

rss

Subscribe with Bloglines

msp@mspland.com

mspland home
filk
LiveJournal
Flickr Photos
Interesting links



Advanced Search

Categories

Calendar

April
Su Mo Tu We Th Fr Sa
       
12
 
2004
Months
Apr

Recent Photos

Currently Reading

Blogroll

My RSS feeds at Bloglines
My LiveJournal friends list
Avweb
Armadillo Aerospace
Perotheus
Creative Commons License
This work is licensed under a Creative Commons License.

powered by blosxom.