source: networking/netprogs/ntp.xml@ 59ed6d46

systemd-13485
Last change on this file since 59ed6d46 was 5fb26b0, checked in by DJ Lucas <dj@…>, 9 years ago

More -systemd.xml file renames.

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