source: networking/netprogs/ntp.xml@ dd9e0c3

systemd-13485
Last change on this file since dd9e0c3 was d7bee48, checked in by Douglas R. Reno <renodr@…>, 8 years ago

Sync to trunk r17332

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@17335 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 13.1 KB
RevLine 
[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
[ac38e9dc]7 <!ENTITY ntp-download-http "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-&ntp-version;.tar.gz">
8<!-- <!ENTITY ntp-download-ftp "&gentoo-ftp-repo;/ntp-&ntp-version;.tar.gz">-->
9 <!ENTITY ntp-download-ftp " ">
[d7bee48]10 <!ENTITY ntp-md5sum "46dfba933c3e4bc924d8e55068797578">
11 <!ENTITY ntp-size "6.8 MB">
12 <!ENTITY ntp-buildsize "94 MB (with tests)">
13 <!ENTITY ntp-time "0.8 SBU (with tests)">
[d47e7ea9]14]>
15
[286c613d]16<sect1 id="ntp" xreflabel="ntp-&ntp-version;">
[dc6715a]17 <?dbhtml filename="ntp.html"?>
[56ab82c]18
[dc6715a]19 <sect1info>
20 <othername>$LastChangedBy$</othername>
21 <date>$Date$</date>
22 </sect1info>
[56ab82c]23
[286c613d]24 <title>ntp-&ntp-version;</title>
[56ab82c]25
[dc6715a]26 <indexterm zone="ntp">
[286c613d]27 <primary sortas="a-ntp">ntp</primary>
[dc6715a]28 </indexterm>
29
30 <sect2 role="package">
[286c613d]31 <title>Introduction to ntp</title>
[56ab82c]32
[286c613d]33 <para>The <application>ntp</application> package contains a
[56ab82c]34 client and server to keep the time synchronized between various computers over
35 a network. This package is the official reference implementation of the
[dc6715a]36 NTP protocol.</para>
[56ab82c]37
[d8aa38f0]38 &lfs79_checked;
[6564aa1]39
[dc6715a]40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing="compact">
42 <listitem>
43 <para>Download (HTTP): <ulink url="&ntp-download-http;"/></para>
44 </listitem>
45 <listitem>
46 <para>Download (FTP): <ulink url="&ntp-download-ftp;"/></para>
47 </listitem>
48 <listitem>
49 <para>Download MD5 sum: &ntp-md5sum;</para>
50 </listitem>
51 <listitem>
52 <para>Download size: &ntp-size;</para>
53 </listitem>
54 <listitem>
55 <para>Estimated disk space required: &ntp-buildsize;</para>
56 </listitem>
57 <listitem>
[2174baa]58 <para>Estimated build time: &ntp-time;</para>
59 </listitem>
[dc6715a]60 </itemizedlist>
[56ab82c]61
[286c613d]62 <bridgehead renderas="sect3">ntp Dependencies</bridgehead>
[56ab82c]63
[ac38e9dc]64 <bridgehead renderas="sect4">Required</bridgehead>
65 <para role="required">
66 <xref linkend="wget"/> (runtime, for <command>update-leap</command>) and
67 <xref linkend="which"/>
68 </para>
69
[dc6715a]70 <bridgehead renderas="sect4">Optional</bridgehead>
[03f32bb]71 <para role="optional">
[b91aa96]72 <xref linkend="libcap-pam"/>,
[ac38e9dc]73 <xref linkend="libevent"/>,
74 <xref linkend="openssl"/>,
75 <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>, and
[b91aa96]76 <ulink url="https://www.gnu.org/software/autogen/">libopts from
77 AutoGen</ulink>
[03f32bb]78 </para>
[56ab82c]79
[061ec9d]80 <para condition="html" role="usernotes">User Notes:
81 <ulink url="&blfs-wiki;/ntp"/></para>
82
[dc6715a]83 </sect2>
[56ab82c]84
[dc6715a]85 <sect2 role="installation">
[286c613d]86 <title>Installation of ntp</title>
[dc6715a]87
[e38cfca]88 <para>
89 There should be a dedicated user and group to take control
90 of the <command>ntpd</command> daemon after it is
91 started. Issue the following commands as the
92 <systemitem class="username">root</systemitem> user:
93 </para>
94
95<screen role="root"><userinput>groupadd -g 87 ntp &amp;&amp;
96useradd -c "Network Time Protocol" -d /var/lib/ntp -u 87 \
97 -g ntp -s /bin/false ntp</userinput></screen>
98
[286c613d]99 <para>Install <application>ntp</application> by running
[dc6715a]100 the following commands:</para>
101
[f82ac3f]102<screen><userinput>./configure --prefix=/usr \
[ac38e9dc]103 --bindir=/usr/sbin \
[2dcc08c0]104 --sysconfdir=/etc \
105 --enable-linuxcaps \
[ac38e9dc]106 --with-lineeditlibs=readline \
107 --docdir=/usr/share/doc/ntp-&ntp-version; &amp;&amp;
[11cf9f2]108make</userinput></screen>
109
[b91aa96]110 <para>To test the results, issue: <command>make check</command>.</para>
[56ab82c]111
[11cf9f2]112 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
[56ab82c]113
[339fbfb9]114<screen role="root"><userinput>make install &amp;&amp;
[b91aa96]115install -v -o ntp -g ntp -d /var/lib/ntp</userinput></screen>
[36474cb]116
117 </sect2>
118
119 <sect2 role="commands">
120 <title>Command Explanations</title>
121
[ac38e9dc]122 <para><parameter>--bindir=/usr/sbin</parameter>: This parameter places
[36474cb]123 the administrative programs in <filename
124 class="directory">/usr/sbin</filename>.</para>
[11cf9f2]125
[2dcc08c0]126 <para><parameter>--enable-linuxcaps</parameter>: ntpd is run as user
127 ntp, so use Linux capabilities for non-root clock control.</para>
128
[a01b1bf]129 <para><option>--with-lineeditlibs=readline</option>: This option enables
130 <application>Readline</application> support for <command>ntpdc</command>
131 and <command>ntpq</command> programs. If omitted,
132 <application>libedit</application> will be used if installed, otherwise no
133 readline capabilites will be compiled.</para>
134
[dc6715a]135 </sect2>
[56ab82c]136
[dc6715a]137 <sect2 role="configuration">
[286c613d]138 <title>Configuring ntp</title>
[56ab82c]139
[dc6715a]140 <sect3 id="ntp-config">
141 <title>Config Files</title>
[56ab82c]142
[dc6715a]143 <para><filename>/etc/ntp.conf</filename></para>
[56ab82c]144
[dc6715a]145 <indexterm zone="ntp ntp-config">
146 <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
147 </indexterm>
[56ab82c]148
[dc6715a]149 </sect3>
[56ab82c]150
[dc6715a]151 <sect3>
152 <title>Configuration Information</title>
153
[ac38e9dc]154 <para>The following configuration file first defines various ntp
155 servers with open access from different continents. Second, it
156 creates a drift file where <command>ntpd</command> stores the
157 frequency offset and a pid file to store the
158 <command>ntpd</command> process ID. Third, it defines the location
159 for the leap-second definition file
160 <filename>/etc/ntp.leapseconds</filename>, that the
[b91aa96]161 <command>update-leap</command> script checks and updates, when
[ac38e9dc]162 necessary. This script can be run as a cron job and the
163 <application>ntp</application> developers recommend a frequency of
164 about three weeks for the updates. Since the documentation included
165 with the package is sparse, visit the ntp website at
166 <ulink url="http://www.ntp.org/"/> and
[a88b03e]167 <ulink url="http://www.pool.ntp.org/"/> for more information.</para>
[dc6715a]168
169<screen role="root"><userinput>cat &gt; /etc/ntp.conf &lt;&lt; "EOF"
[6e26273]170<literal># Asia
[bca6dfb6]171server 0.asia.pool.ntp.org
[d47e7ea9]172
173# Australia
[bca6dfb6]174server 0.oceania.pool.ntp.org
[56ab82c]175
[d47e7ea9]176# Europe
[ea57941f]177server 0.europe.pool.ntp.org
[d47e7ea9]178
179# North America
[ea57941f]180server 0.north-america.pool.ntp.org
181
182# South America
[bca6dfb6]183server 2.south-america.pool.ntp.org
[d47e7ea9]184
[1e72251e]185driftfile /var/lib/ntp/ntp.drift
[ac38e9dc]186pidfile /var/run/ntpd.pid
187
188leapfile /etc/ntp.leapseconds</literal>
189EOF</userinput></screen>
190
191 <para>
[b91aa96]192 You may wish to add a <quote>Security session</quote>. For
193 explanations, see
194 <ulink url="https://www.eecis.udel.edu/~mills/ntp/html/accopt.html#restrict"/>.
195 </para>
[ac38e9dc]196
197<screen role="root"><userinput>cat &gt;&gt; /etc/ntp.conf &lt;&lt; "EOF"
198<literal># Security session
199restrict default limited kod nomodify notrap nopeer noquery
200restrict -6 default limited kod nomodify notrap nopeer noquery
201
202restrict 127.0.0.1
203restrict ::1</literal>
[dc6715a]204EOF</userinput></screen>
205
206 </sect3>
[56ab82c]207
[dc6715a]208 <sect3 id="ntp-init">
209 <title>Synchronizing the Time</title>
210
211 <para>There are two options. Option one is to run <command>ntpd</command>
[56ab82c]212 continuously and allow it to synchronize the time in a gradual manner. The
[dc6715a]213 other option is to run <command>ntpd</command> periodically (using cron)
214 and update the time each time <command>ntpd</command> is scheduled.</para>
[56ab82c]215
[0da88ea3]216 <para>
217 To start the <command>ntpd</command> daemon at boot,
218 install the systemd unit from the <xref linkend="bootscripts"/>
219 package by running the following command as the
220 <systemitem class="username">root</systemitem> user:
221 </para>
[56ab82c]222
223 <indexterm zone="ntp ntp-init">
[dc6715a]224 <primary sortas="f-ntp">ntp</primary>
[56ab82c]225 </indexterm>
[dc6715a]226
[286c613d]227<screen role="root"><userinput>make install-ntpd</userinput></screen>
[dc6715a]228
[56ab82c]229 <para>If you prefer to run <command>ntpd</command> periodically, add the
230 following command to <systemitem class="username">root</systemitem>'s
[dc6715a]231 <filename>crontab</filename>:</para>
[56ab82c]232
[dc6715a]233<screen><literal>ntpd -q</literal></screen>
234
235 </sect3>
[56ab82c]236
[dc6715a]237 </sect2>
[56ab82c]238
[dc6715a]239 <sect2 role="content">
240 <title>Contents</title>
[56ab82c]241
[dc6715a]242 <segmentedlist>
243 <segtitle>Installed Programs</segtitle>
244 <segtitle>Installed Libraries</segtitle>
[ac38e9dc]245 <segtitle>Installed Directories</segtitle>
[56ab82c]246
[dc6715a]247 <seglistitem>
[ac38e9dc]248 <seg>calc_tickadj, ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
249 ntptime, ntptrace, sntp, tickadj and update-leap</seg>
[dc6715a]250 <seg>None</seg>
[ac38e9dc]251 <seg>/usr/share/ntp,
252 /usr/share/doc/ntp-4.2.8 and
253 /var/lib/ntp</seg>
[dc6715a]254 </seglistitem>
255 </segmentedlist>
[56ab82c]256
[dc6715a]257 <variablelist>
258 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
259 <?dbfo list-presentation="list"?>
260 <?dbhtml list-presentation="table"?>
[56ab82c]261
[ac38e9dc]262 <varlistentry id="calc_tickadj">
263 <term><command>calc_tickadj</command></term>
264 <listitem>
265 <para>calculates optimal value for tick given ntp drift file.</para>
266 <indexterm zone="ntp calc_tickadj">
267 <primary sortas="b-calc_tickadj">calc_tickadj</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
[dc6715a]272 <varlistentry id="ntp-keygen">
273 <term><command>ntp-keygen</command></term>
274 <listitem>
[56ab82c]275 <para>generates cryptographic data files used by the NTPv4 authentication
[dc6715a]276 and identification schemes.</para>
277 <indexterm zone="ntp ntp-keygen">
278 <primary sortas="b-ntp-keygen">ntp-keygen</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
[56ab82c]282
[dc6715a]283 <varlistentry id="ntp-wait">
284 <term><command>ntp-wait</command></term>
285 <listitem>
[56ab82c]286 <para>is useful at boot time, to delay the boot sequence until
[dc6715a]287 <command>ntpd</command> has set the time.</para>
288 <indexterm zone="ntp ntp-wait">
289 <primary sortas="b-ntp-wait">ntp-wait</primary>
290 </indexterm>
291 </listitem>
292 </varlistentry>
[56ab82c]293
[dc6715a]294 <varlistentry id="ntpd">
295 <term><command>ntpd</command></term>
296 <listitem>
[286c613d]297 <para>is a ntp daemon that runs in the background and keeps
[56ab82c]298 the date and time synchronized based on response from configured
[286c613d]299 ntp servers. It also functions as a ntp server.</para>
[dc6715a]300 <indexterm zone="ntp ntpd">
301 <primary sortas="b-ntpd">ntpd</primary>
302 </indexterm>
303 </listitem>
304 </varlistentry>
[56ab82c]305
[dc6715a]306 <varlistentry id="ntpdate">
307 <term><command>ntpdate</command></term>
308 <listitem>
[56ab82c]309 <para>is a client program that sets the date and time based on
[286c613d]310 the response from an ntp server. This command is deprecated.</para>
[dc6715a]311 <indexterm zone="ntp ntpdate">
312 <primary sortas="b-ntpdate">ntpdate</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
[56ab82c]316
[dc6715a]317 <varlistentry id="ntpdc">
318 <term><command>ntpdc</command></term>
319 <listitem>
[286c613d]320 <para>is used to query the ntp daemon about its current state
[dc6715a]321 and to request changes in that state.</para>
322 <indexterm zone="ntp ntpdc">
323 <primary sortas="b-ntpdc">ntpdc</primary>
324 </indexterm>
325 </listitem>
326 </varlistentry>
[56ab82c]327
[dc6715a]328 <varlistentry id="ntpq">
329 <term><command>ntpq</command></term>
330 <listitem>
[cb0bbd2]331 <para>is a utility program used to monitor <command>ntpd</command>
[dc6715a]332 operations and determine performance.</para>
333 <indexterm zone="ntp ntpq">
334 <primary sortas="b-ntpq">ntpq</primary>
335 </indexterm>
336 </listitem>
337 </varlistentry>
[56ab82c]338
[dc6715a]339 <varlistentry id="ntptime">
340 <term><command>ntptime</command></term>
341 <listitem>
342 <para>reads and displays time-related kernel variables.</para>
343 <indexterm zone="ntp ntptime">
344 <primary sortas="b-ntptime">ntptime</primary>
345 </indexterm>
346 </listitem>
347 </varlistentry>
[56ab82c]348
[dc6715a]349 <varlistentry id="ntptrace">
350 <term><command>ntptrace</command></term>
351 <listitem>
[286c613d]352 <para>traces a chain of ntp servers back to the primary source.</para>
[dc6715a]353 <indexterm zone="ntp ntptrace">
[56ab82c]354 <primary sortas="b-ntptrace">ntptrace</primary>
[dc6715a]355 </indexterm>
356 </listitem>
357 </varlistentry>
[56ab82c]358
[36474cb]359 <varlistentry id="sntp">
360 <term><command>sntp</command></term>
361 <listitem>
362 <para>is a Simple Network Time Protocol (SNTP) client.</para>
363 <indexterm zone="ntp sntp">
364 <primary sortas="b-sntp">sntp</primary>
365 </indexterm>
366 </listitem>
367 </varlistentry>
368
[dc6715a]369 <varlistentry id="tickadj">
370 <term><command>tickadj</command></term>
371 <listitem>
[56ab82c]372 <para>reads, and optionally modifies, several timekeeping-related
373 variables in older kernels that do not have support for precision
[dc6715a]374 timekeeping.</para>
375 <indexterm zone="ntp tickadj">
376 <primary sortas="b-tickadj">tickadj</primary>
377 </indexterm>
378 </listitem>
379 </varlistentry>
[56ab82c]380
[ac38e9dc]381 <varlistentry id="update-leap">
382 <term><command>update-leap</command></term>
383 <listitem>
384 <para>is a script to verify and, if necessary, update the leap-second
385 definition file.</para>
386 <indexterm zone="ntp update-leap">
387 <primary sortas="b-update-leap">update-leap</primary>
388 </indexterm>
389 </listitem>
390 </varlistentry>
391
[dc6715a]392 </variablelist>
[56ab82c]393
[dc6715a]394 </sect2>
[56ab82c]395
[39f01ca]396</sect1>
Note: See TracBrowser for help on using the repository browser.