NTP-4.1.2

Introduction to NTP

The NTP package contains a client and server to keep the time synchronized between various computers over a network. This package is the official reference implementation of the NTP protocol.

Package information

NTP dependencies

Optional

readline-4.3

Installation of NTP

Install NTP by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring NTP

Config files

/etc/ntp.conf

Configuration Information

The following configuration file defines various NTP servers to use with the primary server designated with the prefer tag. It also creates a drift file where ntpd stores the frequency offset. Since the documentation included with the package is sparse, visit the NTP website at http://www.ntp.org/ for more information.

server time-a.nist.gov prefer
server time-b.nist.gov
server tick.usno.navy.mil
driftfile /var/cache/ntp.drift

Synchronizing the time

There are two options. Option one is to use run ntpd continuously and allow it to synchronize the time in a gradual manner. The other option is to run ntpd periodically (using cron) and update the time each time ntpd is scheduled.

If you choose Option one, then create the bootscript /etc/rc.d/init.d/ntp and put the start and stop symlinks:

#!/bin/bash
# Begin $rc_base/init.d/ntp
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
        start)
                echo "Starting ntpd..."
                loadproc ntpd
                ;;
        stop)
                echo "Stopping ntpd..."
                killproc ntpd
                ;;
        restart)
                $0 stop
                sleep 1
                $0 start
                ;;
        status)
                statusproc ntpd
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac
# End $rc_base/init.d/ntp

If you prefer to start ntpd periodically, add the following command to the root's crontab:

ntpd -q

Contents

The NTP package contains NTP protocol client and server.

Description

ntpd: NTP daemon that runs in the background and keeps the date/time synchronized based on response from configured NTP servers. It also functions as a NTP server.

ntpdate: NTP Client program that sets the date/time based on the response from an NTP Server. This command is deprecated.

ntp-genkeys: This program generates cryptographic data files used by the NTPv4 authentication and identification schemes. a ARPANET file transfer client.

ntpdc and ntpq: Programs to query and set ntpd configuration.

ntptrace: Trace a chain of NTP servers back to the primary source.