Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 3

Time-Related Services

Keeping system clocks synchronized within a network is required for many databases and authentication services. The following topics are covered in this chapter.

Clock Synchronization (Overview)

The Network Time Protocol (NTP) public domain software from the University of Delaware is included in the Solaris software from Solaris 2.6 release forward. The xntpd daemon sets and maintains the system time-of-day. The xntpd daemon is a complete implementation of the version 3 standard, as defined by RFC 1305.

The xntpd daemon reads the /etc/inet/ntp.conf file at system startup. See xntpd(1M) for information about configuration options.

Remember the following when using NTP in your network:

  • The xntpd daemon uses minimal system resources.

  • An NTP client synchronizes automatically with an NTP server when it boots. If the client becomes unsynchronized, the client resynchronizes again when the client contacts a time server.

Another way to synchronize clocks is to run rdate while using cron.

Managing Network Time Protocol (Tasks)

The following procedures show how to set up and use the NTP service.

How to Set Up an NTP Server

  1. Become superuser.

  2. Create the ntp.conf file.

    To ensure proper execution of the xntpd daemon, the ntp.conf file must first be created. The ntp.server file can be used as a template.

    # cd /etc/inet
    # cp ntp.server ntp.conf
  3. Start the xntpd daemon.

    # /etc/init.d/xntpd start

How to Set Up an NTP Client

  1. Become superuser.

  2. Create the ntp.conf file.

    To activate the xntpd daemon, the ntp.conf file must first be created.

    # cd /etc/inet
    # cp ntp.client ntp.conf
  3. Start the xntpd daemon.

    # /etc/init.d/xntpd start

Using Other Time-Related Commands (Tasks)

How to Synchronize Date and Time From Another System

  1. Become superuser.

  2. Reset the date and time to synchronize with another system, by using the rdate command.

    # rdate another-system

    another-system

    Name of the another system

  3. Verify that you have reset your system's date correctly by using the date command.

    The output should show a date and time that matches that of the other system.

Example--Synchronizing Date and Time From Another System

The following example shows how to use rdate to synchronize the date and time of one system with another. In this example, the system earth, running several hours behind, is reset to match the date and time of the server starbug.

earth# date
Tue Jun  5 11:08:27 MDT 2001
earth# rdate starbug
Tue Jun  5 14:06:37 2001
earth# date
Tue Jun  5 14:06:40 MDT 2001

Network Time Protocol (Reference)

The following files are needed for the NTP service to run.

Table 3-1 NTP Files

File Name

Function

/etc/inet/ntp.conf

Lists configuration options for NTP.

/etc/inet/ntp.client

Sample configuration file for NTP clients.

/etc/inet/ntp.server

Sample configuration file for NTP servers.

/etc/inet/ntp.drift

Sets the initial frequency offset on NTP servers.

/etc/inet/ntp.keys

Sample configuration file for NTP servers.

/etc/init.d/xntpd

NTP startup script run when a host is booted.

/usr/lib/inet/xntpd

NTP daemon. See xntpd(1M) for more information.

/usr/sbin/ntpdate

Utility to set the local date and tim,e based on NTP. See ntpdate(1M) for more information.

/usr/sbin/ntpq

NTP query program. See ntpq(1M) for more information.

/usr/sbin/ntptrace

Program to trace NTP hosts back to the master NTP server. See ntptrace(1M) for more information.

/usr/sbin/xntpdc

NTP query program for the xntpd daemon. See xntpdc(1M) for more information.

/var/ntp/ntpstats

Directory for holding NTP statistics.

 
 
 
  Previous   Contents   Next