[d47e7ea9] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[d47e7ea9] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY ntp-download-http "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-&ntp-version;.tar.gz">
|
---|
| 8 | <!ENTITY ntp-download-ftp "ftp://ftp.udel.edu/pub/ntp/ntp4/ntp-&ntp-version;.tar.gz">
|
---|
[f5f7f9d] | 9 | <!ENTITY ntp-md5sum "0f8fabe87cf54f409b57c6283f0c0c3d">
|
---|
[d47e7ea9] | 10 | <!ENTITY ntp-size "2.4 MB">
|
---|
| 11 | <!ENTITY ntp-buildsize "27 MB">
|
---|
| 12 | <!ENTITY ntp-time "0.53 SBU">
|
---|
| 13 | ]>
|
---|
| 14 |
|
---|
[619dd53] | 15 | <sect1 id="ntp" xreflabel="NTP-&ntp-version;">
|
---|
[dc6715a] | 16 | <?dbhtml filename="ntp.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>NTP-&ntp-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="ntp">
|
---|
| 26 | <primary sortas="a-NTP">NTP</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to NTP</title>
|
---|
| 31 |
|
---|
| 32 | <para>The <application>NTP</application> package contains a
|
---|
| 33 | client and server to keep the time synchronized between various computers over
|
---|
| 34 | a network. This package is the official reference implementation of the
|
---|
| 35 | NTP protocol.</para>
|
---|
| 36 |
|
---|
| 37 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 38 | <itemizedlist spacing="compact">
|
---|
| 39 | <listitem>
|
---|
| 40 | <para>Download (HTTP): <ulink url="&ntp-download-http;"/></para>
|
---|
| 41 | </listitem>
|
---|
| 42 | <listitem>
|
---|
| 43 | <para>Download (FTP): <ulink url="&ntp-download-ftp;"/></para>
|
---|
| 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>Download MD5 sum: &ntp-md5sum;</para>
|
---|
| 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download size: &ntp-size;</para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Estimated disk space required: &ntp-buildsize;</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
[2174baa] | 55 | <para>Estimated build time: &ntp-time;</para>
|
---|
| 56 | </listitem>
|
---|
[dc6715a] | 57 | </itemizedlist>
|
---|
| 58 |
|
---|
[db0eb6a] | 59 | <bridgehead renderas="sect3">NTP Dependencies</bridgehead>
|
---|
[dc6715a] | 60 |
|
---|
| 61 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 62 | <para><xref linkend="openssl"/></para>
|
---|
| 63 |
|
---|
| 64 | </sect2>
|
---|
| 65 |
|
---|
| 66 | <sect2 role="installation">
|
---|
| 67 | <title>Installation of NTP</title>
|
---|
| 68 |
|
---|
| 69 | <para>Install <application>NTP</application> by running
|
---|
| 70 | the following commands:</para>
|
---|
| 71 |
|
---|
| 72 | <screen><userinput>./configure --prefix=/usr --bindir=/usr/sbin \
|
---|
[d47e7ea9] | 73 | --sysconfdir=/etc &&
|
---|
| 74 | make &&
|
---|
[dc6715a] | 75 | make install</userinput></screen>
|
---|
| 76 |
|
---|
| 77 | </sect2>
|
---|
| 78 |
|
---|
| 79 | <sect2 role="configuration">
|
---|
| 80 | <title>Configuring NTP</title>
|
---|
| 81 |
|
---|
| 82 | <sect3 id="ntp-config">
|
---|
| 83 | <title>Config Files</title>
|
---|
| 84 |
|
---|
| 85 | <para><filename>/etc/ntp.conf</filename></para>
|
---|
| 86 |
|
---|
| 87 | <indexterm zone="ntp ntp-config">
|
---|
| 88 | <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
|
---|
| 89 | </indexterm>
|
---|
| 90 |
|
---|
| 91 | </sect3>
|
---|
| 92 |
|
---|
| 93 | <sect3>
|
---|
| 94 | <title>Configuration Information</title>
|
---|
| 95 |
|
---|
| 96 | <para>The following configuration file defines various NTP
|
---|
| 97 | stratum 2 servers with open access from different continents. It also
|
---|
| 98 | creates a drift file where <command>ntpd</command> stores the frequency
|
---|
| 99 | offset. Since the documentation included with the package is sparse,
|
---|
| 100 | visit the NTP website at <ulink url="http://www.ntp.org/"/> for more information.</para>
|
---|
| 101 |
|
---|
| 102 | <screen role="root"><userinput>cat > /etc/ntp.conf << "EOF"
|
---|
| 103 | <literal># Africa
|
---|
[d47e7ea9] | 104 | server tock.nml.csir.co.za
|
---|
| 105 |
|
---|
| 106 | # Asia
|
---|
| 107 | server ntp.shim.org
|
---|
| 108 |
|
---|
| 109 | # Australia
|
---|
| 110 | server ntp.saard.net
|
---|
| 111 |
|
---|
| 112 | # Europe
|
---|
| 113 | server ntp.tuxfamily.net
|
---|
| 114 |
|
---|
| 115 | # North America
|
---|
| 116 | server clock.psu.edu
|
---|
| 117 |
|
---|
[dc6715a] | 118 | driftfile /var/cache/ntp.drift</literal>
|
---|
| 119 | EOF</userinput></screen>
|
---|
| 120 |
|
---|
| 121 | </sect3>
|
---|
| 122 |
|
---|
| 123 | <sect3 id="ntp-init">
|
---|
| 124 | <title>Synchronizing the Time</title>
|
---|
| 125 |
|
---|
| 126 | <para>There are two options. Option one is to run <command>ntpd</command>
|
---|
| 127 | continuously and allow it to synchronize the time in a gradual manner. The
|
---|
| 128 | other option is to run <command>ntpd</command> periodically (using cron)
|
---|
| 129 | and update the time each time <command>ntpd</command> is scheduled.</para>
|
---|
| 130 |
|
---|
| 131 | <para>If you choose Option one, then install the
|
---|
| 132 | <filename>/etc/rc.d/init.d/ntp</filename>
|
---|
| 133 | init script included in the
|
---|
| 134 | <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
| 135 |
|
---|
| 136 | <indexterm zone="ntp ntp-init">
|
---|
| 137 | <primary sortas="f-ntp">ntp</primary>
|
---|
| 138 | </indexterm>
|
---|
| 139 |
|
---|
| 140 | <screen role="root"><userinput>make install-ntp</userinput></screen>
|
---|
| 141 |
|
---|
| 142 | <para>If you prefer to run <command>ntpd</command> periodically, add the
|
---|
| 143 | following command to <systemitem class="username">root</systemitem>'s
|
---|
| 144 | <filename>crontab</filename>:</para>
|
---|
| 145 |
|
---|
| 146 | <screen><literal>ntpd -q</literal></screen>
|
---|
| 147 |
|
---|
| 148 | <para>Execute the following command if you would like to set the
|
---|
| 149 | hardware clock at shutdown and reboot based on the current system
|
---|
| 150 | time:</para>
|
---|
| 151 |
|
---|
[e3353b3] | 152 | <screen role="root"><userinput>ln -v -sf ../init.d/setclock /etc/rc.d/rc0.d/K46setclock &&
|
---|
| 153 | ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock</userinput></screen>
|
---|
[dc6715a] | 154 |
|
---|
| 155 | <para>The other way around is already set up by LFS.</para>
|
---|
| 156 |
|
---|
| 157 | </sect3>
|
---|
| 158 |
|
---|
| 159 | </sect2>
|
---|
| 160 |
|
---|
| 161 | <sect2 role="content">
|
---|
| 162 | <title>Contents</title>
|
---|
| 163 |
|
---|
| 164 | <segmentedlist>
|
---|
| 165 | <segtitle>Installed Programs</segtitle>
|
---|
| 166 | <segtitle>Installed Libraries</segtitle>
|
---|
| 167 | <segtitle>Installed Directories</segtitle>
|
---|
| 168 |
|
---|
| 169 | <seglistitem>
|
---|
| 170 | <seg>ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
|
---|
| 171 | ntptime, ntptrace, and tickadj</seg>
|
---|
| 172 | <seg>None</seg>
|
---|
| 173 | <seg>None</seg>
|
---|
| 174 | </seglistitem>
|
---|
| 175 | </segmentedlist>
|
---|
| 176 |
|
---|
| 177 | <variablelist>
|
---|
| 178 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 179 | <?dbfo list-presentation="list"?>
|
---|
| 180 | <?dbhtml list-presentation="table"?>
|
---|
| 181 |
|
---|
| 182 | <varlistentry id="ntp-keygen">
|
---|
| 183 | <term><command>ntp-keygen</command></term>
|
---|
| 184 | <listitem>
|
---|
| 185 | <para>generates cryptographic data files used by the NTPv4 authentication
|
---|
| 186 | and identification schemes.</para>
|
---|
| 187 | <indexterm zone="ntp ntp-keygen">
|
---|
| 188 | <primary sortas="b-ntp-keygen">ntp-keygen</primary>
|
---|
| 189 | </indexterm>
|
---|
| 190 | </listitem>
|
---|
| 191 | </varlistentry>
|
---|
| 192 |
|
---|
| 193 | <varlistentry id="ntp-wait">
|
---|
| 194 | <term><command>ntp-wait</command></term>
|
---|
| 195 | <listitem>
|
---|
| 196 | <para>is useful at boot time, to delay the boot sequence until
|
---|
| 197 | <command>ntpd</command> has set the time.</para>
|
---|
| 198 | <indexterm zone="ntp ntp-wait">
|
---|
| 199 | <primary sortas="b-ntp-wait">ntp-wait</primary>
|
---|
| 200 | </indexterm>
|
---|
| 201 | </listitem>
|
---|
| 202 | </varlistentry>
|
---|
| 203 |
|
---|
| 204 | <varlistentry id="ntpd">
|
---|
| 205 | <term><command>ntpd</command></term>
|
---|
| 206 | <listitem>
|
---|
| 207 | <para>is a NTP daemon that runs in the background and keeps
|
---|
| 208 | the date and time synchronized based on response from configured
|
---|
| 209 | NTP servers. It also functions as a NTP server.</para>
|
---|
| 210 | <indexterm zone="ntp ntpd">
|
---|
| 211 | <primary sortas="b-ntpd">ntpd</primary>
|
---|
| 212 | </indexterm>
|
---|
| 213 | </listitem>
|
---|
| 214 | </varlistentry>
|
---|
| 215 |
|
---|
| 216 | <varlistentry id="ntpdate">
|
---|
| 217 | <term><command>ntpdate</command></term>
|
---|
| 218 | <listitem>
|
---|
| 219 | <para>is a client program that sets the date and time based on
|
---|
| 220 | the response from an NTP server. This command is deprecated.</para>
|
---|
| 221 | <indexterm zone="ntp ntpdate">
|
---|
| 222 | <primary sortas="b-ntpdate">ntpdate</primary>
|
---|
| 223 | </indexterm>
|
---|
| 224 | </listitem>
|
---|
| 225 | </varlistentry>
|
---|
| 226 |
|
---|
| 227 | <varlistentry id="ntpdc">
|
---|
| 228 | <term><command>ntpdc</command></term>
|
---|
| 229 | <listitem>
|
---|
| 230 | <para>is used to query the NTP daemon about its current state
|
---|
| 231 | and to request changes in that state.</para>
|
---|
| 232 | <indexterm zone="ntp ntpdc">
|
---|
| 233 | <primary sortas="b-ntpdc">ntpdc</primary>
|
---|
| 234 | </indexterm>
|
---|
| 235 | </listitem>
|
---|
| 236 | </varlistentry>
|
---|
| 237 |
|
---|
| 238 | <varlistentry id="ntpq">
|
---|
| 239 | <term><command>ntpq</command></term>
|
---|
| 240 | <listitem>
|
---|
| 241 | <para>is an utility program used to monitor <command>ntpd</command>
|
---|
| 242 | operations and determine performance.</para>
|
---|
| 243 | <indexterm zone="ntp ntpq">
|
---|
| 244 | <primary sortas="b-ntpq">ntpq</primary>
|
---|
| 245 | </indexterm>
|
---|
| 246 | </listitem>
|
---|
| 247 | </varlistentry>
|
---|
| 248 |
|
---|
| 249 | <varlistentry id="ntptime">
|
---|
| 250 | <term><command>ntptime</command></term>
|
---|
| 251 | <listitem>
|
---|
| 252 | <para>reads and displays time-related kernel variables.</para>
|
---|
| 253 | <indexterm zone="ntp ntptime">
|
---|
| 254 | <primary sortas="b-ntptime">ntptime</primary>
|
---|
| 255 | </indexterm>
|
---|
| 256 | </listitem>
|
---|
| 257 | </varlistentry>
|
---|
| 258 |
|
---|
| 259 | <varlistentry id="ntptrace">
|
---|
| 260 | <term><command>ntptrace</command></term>
|
---|
| 261 | <listitem>
|
---|
| 262 | <para>traces a chain of NTP servers back to the primary source.</para>
|
---|
| 263 | <indexterm zone="ntp ntptrace">
|
---|
| 264 | <primary sortas="b-ntptrace"></primary>
|
---|
| 265 | </indexterm>
|
---|
| 266 | </listitem>
|
---|
| 267 | </varlistentry>
|
---|
| 268 |
|
---|
| 269 | <varlistentry id="tickadj">
|
---|
| 270 | <term><command>tickadj</command></term>
|
---|
| 271 | <listitem>
|
---|
| 272 | <para>reads, and optionally modifies, several timekeeping-related
|
---|
| 273 | variables in older kernels that do not have support for precision
|
---|
| 274 | timekeeping.</para>
|
---|
| 275 | <indexterm zone="ntp tickadj">
|
---|
| 276 | <primary sortas="b-tickadj">tickadj</primary>
|
---|
| 277 | </indexterm>
|
---|
| 278 | </listitem>
|
---|
| 279 | </varlistentry>
|
---|
| 280 |
|
---|
| 281 | </variablelist>
|
---|
| 282 |
|
---|
| 283 | </sect2>
|
---|
| 284 |
|
---|
[39f01ca] | 285 | </sect1>
|
---|