Ntp

Get binaries from the platform-specific subdirectories of this directory. If you've got redhat linux 5.2 or later, you can use the xntpd rpm, but don't use the default /etc/ntp.conf in the redhat rpm. Similarly if you've got a version of solaris with xntpd included (check for the existence of /etc/init.d/xntpd, for example), you can use it just by creating /etc/inet/ntp.conf (sigh -- you will want to make a symlink from the standard place with "ln -s inet/ntp.conf /etc").

You will want to put xntpd itself in some directory such as /usr/sbin or /usr/etc. Arrange for xntpd to be started upon boot; no command-line arguments ought to be necessary. Alternatively (and inferiorly), use ntpdate the same way you may previously have been using rdate or netdate.

You may not need any other binaries, although I think you'll at least want ntpq. Place ntpq somewhere in your path (perhaps /usr/local/bin). The programs xntpdc, ntptrace, and timetrim (irix only) or tickadj (solaris only) would go somewhere possibly in a sysadmin's path but probably not in a normal user's path; e.g. /usr/sbin or /usr/local/sbin. You don't necessarily need these at all.

Finally, you need to create just one configuration file, /etc/ntp.conf:

server hostname
server hostname
driftfile /etc/ntp.drift
If you don't know what servers to use, consult David Mills's list of public ntp servers.

When you start xntpd, you may next want to run "ntpq -c associations" ("ntpq -c as" for short) and "ntpq -p" to check on it. Don't be alarmed that your servers are listed as "insane"; it will sort matters out gradually.

You want to arrange for your computer's battery-backed clock to get a copy of the ntp-adjusted time occasionally, so that your clock isn't crazy upon reboot. Solaris does this in crontab, although you may have to install /usr/sbin/rtc. For some reason this doesn't seem to be an issue in irix. In linux, you'll want to arrange for "setclock" to be executed in cron; perhaps daily, or perhaps just after daylight savings time starts and stops might be adequate so long as xntpd is always started upon boot (actually I usually do it daily because the clocks on ibm-pc hardware typically lose so badly that if weekly, a reboot causes the time to be off by like half a minute until re-synced).

Documentation is available in the "html" subdirectory of the xntp distribution. You can start by opening the file "index.html" in that directory in your web browser. You may not need to read much or any of it.


At the University of Toronto, if you have a multicast kernel (including modern linux) you can leave out the "server" lines from /etc/ntp.conf and instead use the "multicastclient" command in that file, which makes it listen to a campus-wide ntp broadcast. [example ntp.conf file] (In fact, you don't actually need an /etc/ntp.conf file at all in this case, if you instead use the -m command-line option to mean to listen to the multicast broadcast.) In this case the above ntpq commands won't be of much use to you, but "ntpq -c readvar" might be.

If you don't have a multicast kernel, here is an /etc/ntp.conf file suitable for use at the University of Toronto. Do not use that file at other institutions because the servers it lists are not all public access. David Mills maintains a list of public ntp servers which you should consult.

Other U Toronto information at the UTORtime page.