[d47e7ea9] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[d47e7ea9] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[36474cb] | 7 | <!ENTITY ntp-download-http "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-&ntp-version;.tar.gz">
|
---|
[6564aa1] | 8 | <!ENTITY ntp-download-ftp "&gentoo-ftp-repo;/ntp-&ntp-version;.tar.gz">
|
---|
[10516957] | 9 | <!ENTITY ntp-md5sum "00df80a84ec9528fcfb09498075525bc">
|
---|
| 10 | <!ENTITY ntp-size "4.1 MB">
|
---|
| 11 | <!ENTITY ntp-buildsize "48 MB">
|
---|
[6564aa1] | 12 | <!ENTITY ntp-time "0.5 SBU">
|
---|
[d47e7ea9] | 13 | ]>
|
---|
| 14 |
|
---|
[286c613d] | 15 | <sect1 id="ntp" xreflabel="ntp-&ntp-version;">
|
---|
[dc6715a] | 16 | <?dbhtml filename="ntp.html"?>
|
---|
[56ab82c] | 17 |
|
---|
[dc6715a] | 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
[56ab82c] | 22 |
|
---|
[286c613d] | 23 | <title>ntp-&ntp-version;</title>
|
---|
[56ab82c] | 24 |
|
---|
[dc6715a] | 25 | <indexterm zone="ntp">
|
---|
[286c613d] | 26 | <primary sortas="a-ntp">ntp</primary>
|
---|
[dc6715a] | 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[286c613d] | 30 | <title>Introduction to ntp</title>
|
---|
[56ab82c] | 31 |
|
---|
[286c613d] | 32 | <para>The <application>ntp</application> package contains a
|
---|
[56ab82c] | 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
|
---|
[dc6715a] | 35 | NTP protocol.</para>
|
---|
[56ab82c] | 36 |
|
---|
[5d9021ea] | 37 | &lfs74_checked;
|
---|
[6564aa1] | 38 |
|
---|
[dc6715a] | 39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 40 | <itemizedlist spacing="compact">
|
---|
| 41 | <listitem>
|
---|
| 42 | <para>Download (HTTP): <ulink url="&ntp-download-http;"/></para>
|
---|
| 43 | </listitem>
|
---|
| 44 | <listitem>
|
---|
| 45 | <para>Download (FTP): <ulink url="&ntp-download-ftp;"/></para>
|
---|
| 46 | </listitem>
|
---|
| 47 | <listitem>
|
---|
| 48 | <para>Download MD5 sum: &ntp-md5sum;</para>
|
---|
| 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>Download size: &ntp-size;</para>
|
---|
| 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>Estimated disk space required: &ntp-buildsize;</para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
[2174baa] | 57 | <para>Estimated build time: &ntp-time;</para>
|
---|
| 58 | </listitem>
|
---|
[dc6715a] | 59 | </itemizedlist>
|
---|
[56ab82c] | 60 |
|
---|
[286c613d] | 61 | <!--
|
---|
[abf1070b] | 62 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 63 | <itemizedlist spacing='compact'>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>Required patch: <ulink
|
---|
[6564aa1] | 66 | url="&patch-root;/ntp-&ntp-version;-mod_nano-1.patch"/></para>
|
---|
[abf1070b] | 67 | </listitem>
|
---|
| 68 | </itemizedlist>
|
---|
[286c613d] | 69 | -->
|
---|
| 70 | <bridgehead renderas="sect3">ntp Dependencies</bridgehead>
|
---|
[56ab82c] | 71 |
|
---|
[1580749] | 72 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 73 | <para role="required">
|
---|
| 74 | <xref linkend="libcap2"/>
|
---|
| 75 | </para>
|
---|
| 76 |
|
---|
[dc6715a] | 77 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[03f32bb] | 78 | <para role="optional">
|
---|
| 79 | <xref linkend="openssl"/> and
|
---|
| 80 | <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>
|
---|
| 81 | </para>
|
---|
[56ab82c] | 82 |
|
---|
[061ec9d] | 83 | <para condition="html" role="usernotes">User Notes:
|
---|
| 84 | <ulink url="&blfs-wiki;/ntp"/></para>
|
---|
| 85 |
|
---|
[dc6715a] | 86 | </sect2>
|
---|
[56ab82c] | 87 |
|
---|
[dc6715a] | 88 | <sect2 role="installation">
|
---|
[286c613d] | 89 | <title>Installation of ntp</title>
|
---|
[dc6715a] | 90 |
|
---|
[e38cfca] | 91 | <para>
|
---|
| 92 | There should be a dedicated user and group to take control
|
---|
| 93 | of the <command>ntpd</command> daemon after it is
|
---|
| 94 | started. Issue the following commands as the
|
---|
| 95 | <systemitem class="username">root</systemitem> user:
|
---|
| 96 | </para>
|
---|
| 97 |
|
---|
| 98 | <screen role="root"><userinput>groupadd -g 87 ntp &&
|
---|
| 99 | useradd -c "Network Time Protocol" -d /var/lib/ntp -u 87 \
|
---|
| 100 | -g ntp -s /bin/false ntp</userinput></screen>
|
---|
| 101 |
|
---|
[286c613d] | 102 | <para>Install <application>ntp</application> by running
|
---|
[dc6715a] | 103 | the following commands:</para>
|
---|
| 104 |
|
---|
[2dcc08c0] | 105 | <screen><userinput>
|
---|
| 106 | ./configure --prefix=/usr \
|
---|
| 107 | --sysconfdir=/etc \
|
---|
| 108 | --enable-linuxcaps \
|
---|
| 109 | --with-binsubdir=sbin \
|
---|
| 110 | --with-lineeditlibs=readline &&
|
---|
[11cf9f2] | 111 | make</userinput></screen>
|
---|
| 112 |
|
---|
| 113 | <para>To test the results, issue: <command>make check</command>.</para>
|
---|
[56ab82c] | 114 |
|
---|
[11cf9f2] | 115 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[56ab82c] | 116 |
|
---|
[339fbfb9] | 117 | <screen role="root"><userinput>make install &&
|
---|
[491dcb99] | 118 | install -v -o ntp -g ntp -d /var/lib/ntp &&
|
---|
[339fbfb9] | 119 | install -v -m755 -d /usr/share/doc/ntp-&ntp-version; &&
|
---|
[36474cb] | 120 | cp -v -R html/* /usr/share/doc/ntp-&ntp-version;/</userinput></screen>
|
---|
| 121 |
|
---|
| 122 | </sect2>
|
---|
| 123 |
|
---|
| 124 | <sect2 role="commands">
|
---|
| 125 | <title>Command Explanations</title>
|
---|
| 126 |
|
---|
| 127 | <para><parameter>--with-binsubdir=sbin</parameter>: This parameter places
|
---|
| 128 | the administrative programs in <filename
|
---|
| 129 | class="directory">/usr/sbin</filename>.</para>
|
---|
[11cf9f2] | 130 |
|
---|
[2dcc08c0] | 131 | <para><parameter>--enable-linuxcaps</parameter>: ntpd is run as user
|
---|
| 132 | ntp, so use Linux capabilities for non-root clock control.</para>
|
---|
| 133 |
|
---|
[a01b1bf] | 134 | <para><option>--with-lineeditlibs=readline</option>: This option enables
|
---|
| 135 | <application>Readline</application> support for <command>ntpdc</command>
|
---|
| 136 | and <command>ntpq</command> programs. If omitted,
|
---|
| 137 | <application>libedit</application> will be used if installed, otherwise no
|
---|
| 138 | readline capabilites will be compiled.</para>
|
---|
| 139 |
|
---|
[dc6715a] | 140 | </sect2>
|
---|
[56ab82c] | 141 |
|
---|
[dc6715a] | 142 | <sect2 role="configuration">
|
---|
[286c613d] | 143 | <title>Configuring ntp</title>
|
---|
[56ab82c] | 144 |
|
---|
[dc6715a] | 145 | <sect3 id="ntp-config">
|
---|
| 146 | <title>Config Files</title>
|
---|
[56ab82c] | 147 |
|
---|
[dc6715a] | 148 | <para><filename>/etc/ntp.conf</filename></para>
|
---|
[56ab82c] | 149 |
|
---|
[dc6715a] | 150 | <indexterm zone="ntp ntp-config">
|
---|
| 151 | <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
|
---|
| 152 | </indexterm>
|
---|
[56ab82c] | 153 |
|
---|
[dc6715a] | 154 | </sect3>
|
---|
[56ab82c] | 155 |
|
---|
[dc6715a] | 156 | <sect3>
|
---|
| 157 | <title>Configuration Information</title>
|
---|
| 158 |
|
---|
[286c613d] | 159 | <para>The following configuration file defines various ntp servers
|
---|
[a88b03e] | 160 | with open access from different continents. It also creates a
|
---|
| 161 | drift file where <command>ntpd</command> stores the frequency
|
---|
| 162 | offset and a pid file to store the <command>ntpd</command> process
|
---|
| 163 | ID. Since the documentation included with the package is sparse,
|
---|
[286c613d] | 164 | visit the ntp website at <ulink url="http://www.ntp.org/"/> and
|
---|
[a88b03e] | 165 | <ulink url="http://www.pool.ntp.org/"/> for more information.</para>
|
---|
[dc6715a] | 166 |
|
---|
| 167 | <screen role="root"><userinput>cat > /etc/ntp.conf << "EOF"
|
---|
[6e26273] | 168 | <literal># Asia
|
---|
[bca6dfb6] | 169 | server 0.asia.pool.ntp.org
|
---|
[d47e7ea9] | 170 |
|
---|
| 171 | # Australia
|
---|
[bca6dfb6] | 172 | server 0.oceania.pool.ntp.org
|
---|
[56ab82c] | 173 |
|
---|
[d47e7ea9] | 174 | # Europe
|
---|
[ea57941f] | 175 | server 0.europe.pool.ntp.org
|
---|
[d47e7ea9] | 176 |
|
---|
| 177 | # North America
|
---|
[ea57941f] | 178 | server 0.north-america.pool.ntp.org
|
---|
| 179 |
|
---|
| 180 | # South America
|
---|
[bca6dfb6] | 181 | server 2.south-america.pool.ntp.org
|
---|
[d47e7ea9] | 182 |
|
---|
[1e72251e] | 183 | driftfile /var/lib/ntp/ntp.drift
|
---|
[a5d7e29] | 184 | pidfile /var/run/ntpd.pid</literal>
|
---|
[dc6715a] | 185 | EOF</userinput></screen>
|
---|
| 186 |
|
---|
| 187 | </sect3>
|
---|
[56ab82c] | 188 |
|
---|
[dc6715a] | 189 | <sect3 id="ntp-init">
|
---|
| 190 | <title>Synchronizing the Time</title>
|
---|
| 191 |
|
---|
| 192 | <para>There are two options. Option one is to run <command>ntpd</command>
|
---|
[56ab82c] | 193 | continuously and allow it to synchronize the time in a gradual manner. The
|
---|
[dc6715a] | 194 | other option is to run <command>ntpd</command> periodically (using cron)
|
---|
| 195 | and update the time each time <command>ntpd</command> is scheduled.</para>
|
---|
[56ab82c] | 196 |
|
---|
| 197 | <para>If you choose Option one, then install the
|
---|
[dc6715a] | 198 | <filename>/etc/rc.d/init.d/ntp</filename>
|
---|
| 199 | init script included in the
|
---|
[5254d12] | 200 | <xref linkend="bootscripts"/> package.</para>
|
---|
[56ab82c] | 201 |
|
---|
| 202 | <indexterm zone="ntp ntp-init">
|
---|
[dc6715a] | 203 | <primary sortas="f-ntp">ntp</primary>
|
---|
[56ab82c] | 204 | </indexterm>
|
---|
[dc6715a] | 205 |
|
---|
[286c613d] | 206 | <screen role="root"><userinput>make install-ntpd</userinput></screen>
|
---|
[dc6715a] | 207 |
|
---|
[56ab82c] | 208 | <para>If you prefer to run <command>ntpd</command> periodically, add the
|
---|
| 209 | following command to <systemitem class="username">root</systemitem>'s
|
---|
[dc6715a] | 210 | <filename>crontab</filename>:</para>
|
---|
[56ab82c] | 211 |
|
---|
[dc6715a] | 212 | <screen><literal>ntpd -q</literal></screen>
|
---|
| 213 |
|
---|
| 214 | <para>Execute the following command if you would like to set the
|
---|
[339fbfb9] | 215 | hardware clock to the current system time at shutdown and reboot:</para>
|
---|
[dc6715a] | 216 |
|
---|
[e3353b3] | 217 | <screen role="root"><userinput>ln -v -sf ../init.d/setclock /etc/rc.d/rc0.d/K46setclock &&
|
---|
| 218 | ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock</userinput></screen>
|
---|
[dc6715a] | 219 |
|
---|
| 220 | <para>The other way around is already set up by LFS.</para>
|
---|
[56ab82c] | 221 |
|
---|
[dc6715a] | 222 | </sect3>
|
---|
[56ab82c] | 223 |
|
---|
[dc6715a] | 224 | </sect2>
|
---|
[56ab82c] | 225 |
|
---|
[dc6715a] | 226 | <sect2 role="content">
|
---|
| 227 | <title>Contents</title>
|
---|
[56ab82c] | 228 |
|
---|
[dc6715a] | 229 | <segmentedlist>
|
---|
| 230 | <segtitle>Installed Programs</segtitle>
|
---|
| 231 | <segtitle>Installed Libraries</segtitle>
|
---|
[22292f3a] | 232 | <segtitle>Installed Directory</segtitle>
|
---|
[56ab82c] | 233 |
|
---|
[dc6715a] | 234 | <seglistitem>
|
---|
[56ab82c] | 235 | <seg>ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
|
---|
[36474cb] | 236 | ntptime, ntptrace, sntp and tickadj</seg>
|
---|
[dc6715a] | 237 | <seg>None</seg>
|
---|
[22292f3a] | 238 | <seg>/usr/share/doc/ntp-&ntp-version;</seg>
|
---|
[dc6715a] | 239 | </seglistitem>
|
---|
| 240 | </segmentedlist>
|
---|
[56ab82c] | 241 |
|
---|
[dc6715a] | 242 | <variablelist>
|
---|
| 243 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 244 | <?dbfo list-presentation="list"?>
|
---|
| 245 | <?dbhtml list-presentation="table"?>
|
---|
[56ab82c] | 246 |
|
---|
[dc6715a] | 247 | <varlistentry id="ntp-keygen">
|
---|
| 248 | <term><command>ntp-keygen</command></term>
|
---|
| 249 | <listitem>
|
---|
[56ab82c] | 250 | <para>generates cryptographic data files used by the NTPv4 authentication
|
---|
[dc6715a] | 251 | and identification schemes.</para>
|
---|
| 252 | <indexterm zone="ntp ntp-keygen">
|
---|
| 253 | <primary sortas="b-ntp-keygen">ntp-keygen</primary>
|
---|
| 254 | </indexterm>
|
---|
| 255 | </listitem>
|
---|
| 256 | </varlistentry>
|
---|
[56ab82c] | 257 |
|
---|
[dc6715a] | 258 | <varlistentry id="ntp-wait">
|
---|
| 259 | <term><command>ntp-wait</command></term>
|
---|
| 260 | <listitem>
|
---|
[56ab82c] | 261 | <para>is useful at boot time, to delay the boot sequence until
|
---|
[dc6715a] | 262 | <command>ntpd</command> has set the time.</para>
|
---|
| 263 | <indexterm zone="ntp ntp-wait">
|
---|
| 264 | <primary sortas="b-ntp-wait">ntp-wait</primary>
|
---|
| 265 | </indexterm>
|
---|
| 266 | </listitem>
|
---|
| 267 | </varlistentry>
|
---|
[56ab82c] | 268 |
|
---|
[dc6715a] | 269 | <varlistentry id="ntpd">
|
---|
| 270 | <term><command>ntpd</command></term>
|
---|
| 271 | <listitem>
|
---|
[286c613d] | 272 | <para>is a ntp daemon that runs in the background and keeps
|
---|
[56ab82c] | 273 | the date and time synchronized based on response from configured
|
---|
[286c613d] | 274 | ntp servers. It also functions as a ntp server.</para>
|
---|
[dc6715a] | 275 | <indexterm zone="ntp ntpd">
|
---|
| 276 | <primary sortas="b-ntpd">ntpd</primary>
|
---|
| 277 | </indexterm>
|
---|
| 278 | </listitem>
|
---|
| 279 | </varlistentry>
|
---|
[56ab82c] | 280 |
|
---|
[dc6715a] | 281 | <varlistentry id="ntpdate">
|
---|
| 282 | <term><command>ntpdate</command></term>
|
---|
| 283 | <listitem>
|
---|
[56ab82c] | 284 | <para>is a client program that sets the date and time based on
|
---|
[286c613d] | 285 | the response from an ntp server. This command is deprecated.</para>
|
---|
[dc6715a] | 286 | <indexterm zone="ntp ntpdate">
|
---|
| 287 | <primary sortas="b-ntpdate">ntpdate</primary>
|
---|
| 288 | </indexterm>
|
---|
| 289 | </listitem>
|
---|
| 290 | </varlistentry>
|
---|
[56ab82c] | 291 |
|
---|
[dc6715a] | 292 | <varlistentry id="ntpdc">
|
---|
| 293 | <term><command>ntpdc</command></term>
|
---|
| 294 | <listitem>
|
---|
[286c613d] | 295 | <para>is used to query the ntp daemon about its current state
|
---|
[dc6715a] | 296 | and to request changes in that state.</para>
|
---|
| 297 | <indexterm zone="ntp ntpdc">
|
---|
| 298 | <primary sortas="b-ntpdc">ntpdc</primary>
|
---|
| 299 | </indexterm>
|
---|
| 300 | </listitem>
|
---|
| 301 | </varlistentry>
|
---|
[56ab82c] | 302 |
|
---|
[dc6715a] | 303 | <varlistentry id="ntpq">
|
---|
| 304 | <term><command>ntpq</command></term>
|
---|
| 305 | <listitem>
|
---|
[56ab82c] | 306 | <para>is an utility program used to monitor <command>ntpd</command>
|
---|
[dc6715a] | 307 | operations and determine performance.</para>
|
---|
| 308 | <indexterm zone="ntp ntpq">
|
---|
| 309 | <primary sortas="b-ntpq">ntpq</primary>
|
---|
| 310 | </indexterm>
|
---|
| 311 | </listitem>
|
---|
| 312 | </varlistentry>
|
---|
[56ab82c] | 313 |
|
---|
[dc6715a] | 314 | <varlistentry id="ntptime">
|
---|
| 315 | <term><command>ntptime</command></term>
|
---|
| 316 | <listitem>
|
---|
| 317 | <para>reads and displays time-related kernel variables.</para>
|
---|
| 318 | <indexterm zone="ntp ntptime">
|
---|
| 319 | <primary sortas="b-ntptime">ntptime</primary>
|
---|
| 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
[56ab82c] | 323 |
|
---|
[dc6715a] | 324 | <varlistentry id="ntptrace">
|
---|
| 325 | <term><command>ntptrace</command></term>
|
---|
| 326 | <listitem>
|
---|
[286c613d] | 327 | <para>traces a chain of ntp servers back to the primary source.</para>
|
---|
[dc6715a] | 328 | <indexterm zone="ntp ntptrace">
|
---|
[56ab82c] | 329 | <primary sortas="b-ntptrace">ntptrace</primary>
|
---|
[dc6715a] | 330 | </indexterm>
|
---|
| 331 | </listitem>
|
---|
| 332 | </varlistentry>
|
---|
[56ab82c] | 333 |
|
---|
[36474cb] | 334 | <varlistentry id="sntp">
|
---|
| 335 | <term><command>sntp</command></term>
|
---|
| 336 | <listitem>
|
---|
| 337 | <para>is a Simple Network Time Protocol (SNTP) client.</para>
|
---|
| 338 | <indexterm zone="ntp sntp">
|
---|
| 339 | <primary sortas="b-sntp">sntp</primary>
|
---|
| 340 | </indexterm>
|
---|
| 341 | </listitem>
|
---|
| 342 | </varlistentry>
|
---|
| 343 |
|
---|
[dc6715a] | 344 | <varlistentry id="tickadj">
|
---|
| 345 | <term><command>tickadj</command></term>
|
---|
| 346 | <listitem>
|
---|
[56ab82c] | 347 | <para>reads, and optionally modifies, several timekeeping-related
|
---|
| 348 | variables in older kernels that do not have support for precision
|
---|
[dc6715a] | 349 | timekeeping.</para>
|
---|
| 350 | <indexterm zone="ntp tickadj">
|
---|
| 351 | <primary sortas="b-tickadj">tickadj</primary>
|
---|
| 352 | </indexterm>
|
---|
| 353 | </listitem>
|
---|
| 354 | </varlistentry>
|
---|
[56ab82c] | 355 |
|
---|
[dc6715a] | 356 | </variablelist>
|
---|
[56ab82c] | 357 |
|
---|
[dc6715a] | 358 | </sect2>
|
---|
[56ab82c] | 359 |
|
---|
[39f01ca] | 360 | </sect1>
|
---|