Post details: Network Time Protocol Daemon

08/12/06

Permalink Categories: Guides   English (US)

Network Time Protocol Daemon

NTP is designed to keep clocks on multiple servers synchronized to Atomic TimeNTPd is part of the FreeBSD base files. You can install the daemon from ports but that is not covered in this document

  • A CLI editor such as eeNTPd this file is a must. There are two parts to this file; however, the second part is not necessary since it is covered in the start command. Below I have listed my ntp.conftime serversNTPd as soon as the server starts up. To do this, open the file with your favorite editor and add the following lines to the end. The first line tells the the system to enable NTPd. The second line instructs the server to sync when initially started. Pretty simple stuff.

    # NTPd
    ntpd_enable="YES"
    ntpd_sync_on_start="YES"

    Starting NTPd


    Now there's not much left to do except start the server. That can be accomplished by using the RC script /etc/rc.d/ntpd.

    baku# /etc/rc.d/ntpd status
    ntpd is not running.
    baku# /etc/rc.d/ntpd start
    Starting ntpd.
    baku# /etc/rc.d/ntpd status
    ntpd is running as pid 50037.
    baku#

    You can verify that the server is running with a couple of quick checks. You can tail the log file or you can look in the process list. Another check is using the date command.

    baku# ps x | grep ntp
    50037 ?? Ss 0:00.10 /usr/sbin/ntpd -g -p /var/run/ntpd.pid -f /var/db/ntpd.drift
    50045 ?? S 0:00.00 /usr/sbin/ntpd -g -p /var/run/ntpd.pid -f /var/db/ntpd.drift
    baku# date
    Fri Aug 11 18:25:52 CDT 2006
    baku#

    Earlier I mentioned that the second part of the configuration file wasn't necessary. The reasoning for this is because of the command issued from the RC script to start the daemon above. The switch and file (-f /var/db/ntpd.drift) are there to keep a log of your clock's tendency to drift and compensates for it.

    Conclusion


    See, that wasn't very hard now was it? Keeping your time accurate is very useful. There are more things you can do with NTPd like securing your daemon so that your network is the only one with access to it. You can also leave it open to share your daemon as a Stratum 2 server. These are more advanced techniques, but that's for another article.

    References


    ntp.confNetwork Time ProtocolNTP Public Services ProjectClock Synchronization with NTP

  • Comments:

    Comment from: smurf [Member] Email · http://www.eluid.org
    That's pretty interesting about the clocks drifting over time, I always figured that if you have a full charged battery then your clock would stay dead on but I guess not.
    PermalinkPermalink 08/12/06 @ 17:44

    This post has 2 feedbacks awaiting moderation...

    Leave a comment:

    Your email address will not be displayed on this site.
    Your URL will be displayed.

    Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
    (Line breaks become <br />)
    (Set cookies for name, email and url)
    (Allow users to contact you through a message form (your email will NOT be displayed.))
    This is a captcha-picture. It is used to prevent mass-access by robots.

    Please enter the characters from the image above. (case insensitive)

    Retarded Kids

    FreeBSD and Unix/Linux information and software to make it more secure.

    February 2012
    Sun Mon Tue Wed Thu Fri Sat
    << <     
          1 2 3 4
    5 6 7 8 9 10 11
    12 13 14 15 16 17 18
    19 20 21 22 23 24 25
    26 27 28 29      

    Search

    Categories

    Linkblog

    Links

    Syndicate this blog XML

    What is RSS?

    powered by
    b2evolution