- Obtain ntp distribution from:
ftp://ftp.udel.edu/pub/ntp/xntpd3.5f.tar.Z
- Open the package:
mkdir ntp
uncompress xntpd3.5f.tar.Z
mv xntpd3.5f.tar ntp
cd ntp
tar xpf xntpd3.5f.tar.Z
- Port to IRIX 6.2:
make Config
mkdir -p /usr/local/bin /usr/local/etc
- Edit the file Config and add the -cckr flag as an arg for COPTS.
- If desired, edit the ntp poll interval to allow a higher poll rate, in the file include/ntp.h.
#define NTP_MINPOLL 1 /* log2 min poll interval (2 s) */
ntp will dynamically change the poll rate to fall within the min/max range, depending on how well the clock is synchronized. On startup, the poll rate is higher. As ntp runs, the poll rate will decrease because ntp has had time to create a good statistical model of the system clock, including its non-linearities. A NTP_MINPOLL of "1" will set the min poll interval to 2^1=2.
- If desired, modify ntp step threshold (CLOCK.MAX in RFC 1305), in the file include/ntp.h (see RFC 1305, Sections 5.2 and 5.3 for detailed discussions on changing CLOCK.MAX). The example below changes the step size from 128ms (default) to 896 ms:
#define CLOCK_MAX_FP 0x0000003b /*max clock offset (s_fp 896 usec ) */
#define CLOCK_MAX_F 0x003ab863 /*max clock offset (l_fp 896 usec) */
Note that these constants are of type s_fp and l_fp. s_fp is a 32-bit structure; bits 0-15 represent seconds, and bits 15-31 represent fractional seconds. Resolution is 1/2^16 =~ 15.26 ms per bit. l_fp is a similar 64-bit structure, resolution is 1/2^32 =~ 233 psec. The default value is 128 ms (0x20c5 and0x20c49ba6, respectively for s_fp and l_fp). To change this value to 896 ms:
896 usec / ( 1/2^16) = 59 = 0x0000003b (s_fp)
896 usec / ( 1/2^32) = 3,848,291 = 0x003ab863 (l_fp)
- Create and install the executables:
make install
- Create the IRIX ntp startup script /etc/init.d/ntp per Listing 1.
Add the following link:
ln -s /etc/init.d/ntp /etc/rc2.d/S94ntp
- From a shell, create an IRIX ntp on/off file /etc/config/ntp with the following shell command:
echo on > /etc/config/ntp
- The ntp configuration files, ntp.conf are automatically generated by the ntp boot script, so modify that file to change any configurations.
- If you know in advance what the drift values are for the Stratum 1 machines (in ntp.drift), then update the ntp boot script with those values. If you don't know the drift value, update the boot script with a value of "0.000" for drift.
- Ensure the timezone variable is set correctly in /etc/TIMEZONE
TZ=EST5EDT
See timezone (4) for information on this file.
- Ensure timed(1M) and timeslave(1M) are not running and won't be restarted on bootup.
- Start ntp, beginning with the lowest numbered stratum machines, either by rebooting or running the startup script.
- The ntp Stratum 1 server will start up, and make something like this entry in the log file ntp.log
19 Jul 16:35:02 xntpd[543]: logging to file /usr/local/etc/ntp.log
19 Jul 16: 35:02 xntpd[543]: xntpd version=3.5f; Tue Jun 11 07:15:53 PDT 1996 (1)
19 Jul 16: 35:02 xntpd[543]: tickadj = 150, tick = 10000, tvu_maxslew = 14850
19 Jul 16:35:02 xntpd[543]: precision = 10 usec
19 Jul 16:35:19 xntpd[543]: synchronized to LOCAL(0), stratum=3
- The ntp Stratum 2 client(s) will start up, and make something like this entry in the log file ntp.log:
19 Jul 15:35:51 xntpd[123]: logging to file /usr/local/etc/ntp.log
19 Jul 15: 35:51 xntpd[123]: xntpd version=3.5f; Tue Jul 16 08:33:09 EDT 1996 (1)
19 Jul 15: 35:51 xntpd[123]: tickadj = 150, tick = 10000, tvu_maxslew = 14850
19 Jul 15:35:51 xntpd[123]: precision = 6 usec
19 Jul 15:36:11 xntpd[123]: synchronized to 192.107.161.120, stratum=5
Note that 192.107.161.120 is the IP address of the Stratum 1 machine in this example only.
- Check platform synchronization using the following shell commands on each machine:
To check the offset between a machine and UTC:
/usr/local/bin/xntpdc -c loopinfo|grep offset
To check the current drift value of a machine:
/usr/local/bin/xntpdc -c loopinfo|grep frequency
To check which server you are synchronized to, and the offset:
/usr/local/bin/ntpq -c peers
Note an asterisk denotes the client is synchronized to the server.
To see miscellaneous ntp variables like poll rate, etc.:
/usr/local/bin/ntpq -c readvar
xntpdc and ntpq are supplied with the ntp distribution to aid in debugging.