12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Network Services—Internet ServersHowever, your server may get out of sync because you are unlikely to reboot yourservers frequently. The ntpd(8) utility does this by running as a daemon in thebackground and keeping time synchronized with the servers that you have specified.The ntpd daemon also acts as the NTP server that can be used as a clock reference foryour local hosts.NTP ServerRunning ntpd(8) can be very useful for keeping local time in sync, as well as servingas an accurate clock for other hosts in your network. Configuring ntpd is as easyas setting up the configuration file located at /etc/ntp.conf and starting the ntpdaemon (which is already included in the base system).A default ntp.conf file does not come with the default installation and it should becreated from scratch. The configuration should consist of the definitions for one ormore servers, as well as a drift file address, as shown here:server pool.ntp.org preferserver ntp0.nl.uu.netserver clock.isc.orgdriftfile /var/db/ntp.driftThe configuration, above, has introduced three servers (to make sure you alwayshave accurate time), and marked the first server as prefer. The drift file is thefile that ntpd keeps the calculated drift value in. So it knows the drift value acrossserver restarts.The server can then be enabled by adding the following line to the rc.conf file:ntpd_enable="YES"It may take a few minutes before your ntp server shows accurate time.This can be verified by querying the server using the ntpq(8) utility.To view the current status of the ntpd (running on the same server), you mayuse ntpq(8):# ntpq -c rvstatus=06d4 leap_none, sync_ntp, 13 events, event_peer/strat_chg,version="ntpd 4.2.0-a Mon Jul 16 09:19:35 BST 2007 (1)",processor="i386", system="FreeBSD/7.0-STABLE", leap=00, stratum=2,precision=-19, rootdelay=343.773, rootdispersion=290.834, peer=55622,refid=192.43.244.18,reftime=cade029c.cad8daf3 Fri, Nov 9 2007 1:18:12.792, poll=10,clock=cade0320.d6d74a76 Fri, Nov 9 2007 1:20:24.839, state=4,offset=51.066, frequency=25.407, jitter=16.671, stability=0.738[ 214 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!