Time synchronization - xntpd

2009-05-13 13:18:14来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


This article shows you how to ensure the clock on your computer is kept synchronized. It originally dealt only with xntpd, but this is also applicable to ntpd.
See also
NTP
in the
FreeBSD Handbook
.
Details for 5.x were added on 15 July 2004.
2 August 1998
Late last night I was reading up on
Apache
, the http server.  It seems a good idea to install a time synchronization daemon because parts of http are expressed as the time of day.  So I started looking up some information.  xntpd is a Network Time Protocol daemon.  I decided to go with that.  It comes with FreeBSD; very little effort is required to get it running.
NOTE: under later versions of FreeBSD, notably 4.*, the xntpd binary has been replaced with ntpd.  However, the following options will work as shown.
In the
mailing list archives
I found a
message
which showed how to install xntpd.  In brief, it outlined the following steps:
1.  Create /etc/ntp.conf:
        server
        driftfile /etc/ntp.drift
       
        Note: Under 5.*, you do not have to include the driftfile line.
2.  Enable xntpd by adding the following entries to /etc/rc.conf.  
    See /etc/defaults/rc.conf for the values you need.  They
    should look something like this:    Under 3.*
        xntpd_enable="YES"
        xntpd_flags="-c /etc/ntp.conf -p /var/run/xntpd.pid"    Under 4.*, you should use this
        xntpd_enable="YES"
        xntpd_flags="-c /etc/ntp.conf -p /var/run/ntpd.pid"    Under 5.*, you should use this
        ntpd_enable="YES"3.  On the next reboot you'll be syncing clocks automatically.4.  Or you can issue this command:    Under 3.*      /usr/sbin/xntpd -c /etc/ntp.conf -p /var/run/xntpd.pid    but under 4.*,
      /usr/sbin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid    and under 5.*,
      /usr/sbin/ntpd -p /var/run/ntpd.pid -f /var/db/ntpd.driftFor more information on xntpd, try man xntpd or
the
online manual
.
I use my ISP as a time server.  You might want to ask your ISP if they provide such a service.  If they do, use them.  If they don't, try the one resources listed at the end of this article.  It's also been pointed out to me that it might pay to use more than one timer server.

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:resolv.conf is being modified,

下一篇:installing www server (apache)