Thursday, July 17, 2008

Activate NTP Service in Solaris

In our particular case we just need that the machine has its time synchronized:

At /etc/inet directory we have two files:

ntp.client
ntp.server


Copy the /etc/inet/ntp.client file into /etc/inet/ntp.conf.

The content of that file is as follows:

# ident "@(#)ntp.client 1.3 00/07/17 SMI"
#
# /etc/inet/ntp.client
#
# An example file that could be copied over to /etc/inet/ntp.conf; it
# provides a configuration for a host that passively waits for a server
# to provide NTP packets on the ntp multicast net.
#

multicastclient 224.0.1.1


This should work but the routers generally drops this kind of multicast messages, so we must do some changes in the file.

driftfile /var/ntp/ntp.drift
restrict 127.0.0.1
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
statsdir /var/ntp/ntpstats/


Make sure the /var/ntp/ntp.drift file exists (touch /var/ntp/ntp.drift).

Make sure the directory /var/ntp/ntpstats/ exists.

Start the service with svcadm enable ntp.

You could check /var/adm/messages and /var/svc/log/network-ntp:default.log logs.

You could query the service with ntpq –p.

remote refid st t when poll reach delay offset disp
==============================================================================
smtp.housefront enigma.wiredgoa 3 u 865 1024 377 105.15 10.086 0.43
*time.nist.gov .ACTS. 1 u 75 1024 377 110.12 0.315 1.59
+dnscache1.izoom ntp2.twc.weathe 2 u 160 1024 377 68.21 -32.835 11.49


The ntpdate host command could be used for a one time updating of the system time.

No comments: