source: networking/netprogs/ntp.xml@ 22c3cdd7

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.0 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 22c3cdd7 was 22c3cdd7, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Tag remaining netwroking paclages

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22035 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 14.7 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
[f4a1b66]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 " ">
[776e52d]9 <!ENTITY ntp-md5sum "ea040ab9b4ca656b5229b89d6b822f13">
10 <!ENTITY ntp-size "6.6 MB">
11 <!ENTITY ntp-buildsize "117 MB (with tests)">
[77882028]12 <!ENTITY ntp-time "0.8 SBU (with tests)">
[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
[22c3cdd7]37 &lfs90_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 <bridgehead renderas="sect3">ntp Dependencies</bridgehead>
[56ab82c]62
[77882028]63 <bridgehead renderas="sect4">Required</bridgehead>
64 <para role="required">
[4392a40]65 <xref linkend="perl-io-socket-ssl"/>
[77882028]66 </para>
[0d0f150]67
[77882028]68<!-- Tested 4.2.8p11 with neither wget nor lynx on system: Not required.
[b3dc2ba]69 <bridgehead renderas="sect4">Recommended</bridgehead>
70 <para role="recommended">
[45029cb]71 <xref role="runtime" linkend="wget"/> (runtime, for
72 <command>update-leap</command>)
[77882028]73<!- - The download code for update-leap uses the File::Fetch perl module,
[45029cb]74 which may use wget, or lynx, or some core perl modules, so maybe move
[77882028]75 to optional - ->
[e3cbfaf]76 </para>
[77882028]77-->
[dc6715a]78 <bridgehead renderas="sect4">Optional</bridgehead>
[03f32bb]79 <para role="optional">
[56605b9]80 <xref linkend="libcap-pam"/>,
[4c10b88]81 <xref linkend="libevent"/>,
[e3cbfaf]82 <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>, and
[94b42903]83 <ulink url="https://www.gnu.org/software/autogen/">libopts from AutoGen</ulink>
[03f32bb]84 </para>
[56ab82c]85
[061ec9d]86 <para condition="html" role="usernotes">User Notes:
87 <ulink url="&blfs-wiki;/ntp"/></para>
88
[dc6715a]89 </sect2>
[56ab82c]90
[dc6715a]91 <sect2 role="installation">
[286c613d]92 <title>Installation of ntp</title>
[dc6715a]93
[e38cfca]94 <para>
95 There should be a dedicated user and group to take control
96 of the <command>ntpd</command> daemon after it is
97 started. Issue the following commands as the
98 <systemitem class="username">root</systemitem> user:
99 </para>
100
101<screen role="root"><userinput>groupadd -g 87 ntp &amp;&amp;
102useradd -c "Network Time Protocol" -d /var/lib/ntp -u 87 \
103 -g ntp -s /bin/false ntp</userinput></screen>
104
[b3dc2ba]105<!-- At least one of the issues has been reported upstream. The next para
106 is valid for 4.8.2p10 -->
107 <para>
108 The <command>update-leap</command> command needs to be fixed in order
109 to run properly:
110 </para>
111
[77882028]112<screen><userinput>sed -e 's/"(\\S+)"/"?([^\\s"]+)"?/' \
[b3dc2ba]113 -i scripts/update-leap/update-leap.in</userinput></screen>
114
115 <para>
116 Install <application>ntp</application> by running
117 the following commands:
118 </para>
[dc6715a]119
[eecae1f9]120<screen><userinput>./configure CFLAGS="-O2 -g -fPIC" \
121 --prefix=/usr \
[78b797d]122 --bindir=/usr/sbin \
[2dcc08c0]123 --sysconfdir=/etc \
124 --enable-linuxcaps \
[78b797d]125 --with-lineeditlibs=readline \
126 --docdir=/usr/share/doc/ntp-&ntp-version; &amp;&amp;
[11cf9f2]127make</userinput></screen>
128
[b3dc2ba]129 <para>
130 To test the results, issue: <command>make check</command>.
131 </para>
[56ab82c]132
[b3dc2ba]133 <para>
134 Now, as the <systemitem class="username">root</systemitem> user:
135 </para>
[56ab82c]136
[339fbfb9]137<screen role="root"><userinput>make install &amp;&amp;
[78b797d]138install -v -o ntp -g ntp -d /var/lib/ntp</userinput></screen>
[36474cb]139
140 </sect2>
141
142 <sect2 role="commands">
143 <title>Command Explanations</title>
144
[eecae1f9]145 <para><envar>CFLAGS="-O2 -g -fPIC"</envar>: This environment variable
146 is necessary to generate Position Independent Code needed for
147 use in the package libraries.</para>
148
[78b797d]149 <para><parameter>--bindir=/usr/sbin</parameter>: This parameter places
[36474cb]150 the administrative programs in <filename
151 class="directory">/usr/sbin</filename>.</para>
[11cf9f2]152
[2dcc08c0]153 <para><parameter>--enable-linuxcaps</parameter>: ntpd is run as user
154 ntp, so use Linux capabilities for non-root clock control.</para>
155
[f7841987]156 <para><parameter>--with-lineeditlibs=readline</parameter>: This switch
157 enables <application>Readline</application> support for
158 <command>ntpdc</command> and <command>ntpq</command> programs. If omitted,
[a01b1bf]159 <application>libedit</application> will be used if installed, otherwise no
160 readline capabilites will be compiled.</para>
161
[dc6715a]162 </sect2>
[56ab82c]163
[dc6715a]164 <sect2 role="configuration">
[286c613d]165 <title>Configuring ntp</title>
[56ab82c]166
[dc6715a]167 <sect3 id="ntp-config">
168 <title>Config Files</title>
[56ab82c]169
[dc6715a]170 <para><filename>/etc/ntp.conf</filename></para>
[56ab82c]171
[dc6715a]172 <indexterm zone="ntp ntp-config">
173 <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
174 </indexterm>
[56ab82c]175
[dc6715a]176 </sect3>
[56ab82c]177
[dc6715a]178 <sect3>
179 <title>Configuration Information</title>
180
[ab6a3f3]181 <para>The following configuration file first defines various ntp
182 servers with open access from different continents. Second, it
183 creates a drift file where <command>ntpd</command> stores the
184 frequency offset and a pid file to store the
185 <command>ntpd</command> process ID. Third, it defines the location
186 for the leap-second definition file
187 <filename>/etc/ntp.leapseconds</filename>, that the
188 <command>update-leap</command> script checks and updates, when
189 necessary. This script can be run as a cron job and the
190 <application>ntp</application> developers recommend a frequency of
191 about three weeks for the updates. Since the documentation included
192 with the package is sparse, visit the ntp website at
193 <ulink url="http://www.ntp.org/"/> and
[a88b03e]194 <ulink url="http://www.pool.ntp.org/"/> for more information.</para>
[dc6715a]195
196<screen role="root"><userinput>cat &gt; /etc/ntp.conf &lt;&lt; "EOF"
[6e26273]197<literal># Asia
[bca6dfb6]198server 0.asia.pool.ntp.org
[d47e7ea9]199
200# Australia
[bca6dfb6]201server 0.oceania.pool.ntp.org
[56ab82c]202
[d47e7ea9]203# Europe
[ea57941f]204server 0.europe.pool.ntp.org
[d47e7ea9]205
206# North America
[ea57941f]207server 0.north-america.pool.ntp.org
208
209# South America
[bca6dfb6]210server 2.south-america.pool.ntp.org
[d47e7ea9]211
[1e72251e]212driftfile /var/lib/ntp/ntp.drift
[ab6a3f3]213pidfile /var/run/ntpd.pid
214
215leapfile /etc/ntp.leapseconds</literal>
[78b797d]216EOF</userinput></screen>
217
[39159bf]218 <para>
219 You may wish to add a <quote>Security session</quote>. For
220 explanations, see
[f4a1b66]221 <ulink url="https://www.eecis.udel.edu/~mills/ntp/html/accopt.html#restrict"/>.
[39159bf]222 </para>
[78b797d]223
224<screen role="root"><userinput>cat &gt;&gt; /etc/ntp.conf &lt;&lt; "EOF"
225<literal># Security session
[e5bb823]226restrict default limited kod nomodify notrap nopeer noquery
[78b797d]227restrict -6 default limited kod nomodify notrap nopeer noquery
228
229restrict 127.0.0.1
230restrict ::1</literal>
[dc6715a]231EOF</userinput></screen>
232
233 </sect3>
[56ab82c]234
[dc6715a]235 <sect3 id="ntp-init">
236 <title>Synchronizing the Time</title>
237
238 <para>There are two options. Option one is to run <command>ntpd</command>
[56ab82c]239 continuously and allow it to synchronize the time in a gradual manner. The
[dc6715a]240 other option is to run <command>ntpd</command> periodically (using cron)
241 and update the time each time <command>ntpd</command> is scheduled.</para>
[56ab82c]242
243 <para>If you choose Option one, then install the
[7b478500]244 <phrase revision="sysv"><filename>/etc/rc.d/init.d/ntp</filename>
245 init script</phrase>
246 <phrase revision="systemd"><filename>ntpd.service</filename> unit</phrase>
247 included in the
[3c7bd00]248 <xref linkend="bootscripts" revision="sysv"/>
249 <xref linkend="systemd-units" revision="systemd"/> package.</para>
[56ab82c]250
[7b478500]251 <indexterm zone="ntp ntp-init" revision="sysv">
[dc6715a]252 <primary sortas="f-ntp">ntp</primary>
[56ab82c]253 </indexterm>
[dc6715a]254
[7b478500]255 <indexterm zone="ntp ntp-init" revision="systemd">
256 <primary sortas="f-ntpd">ntpd.service</primary>
257 </indexterm>
258
[286c613d]259<screen role="root"><userinput>make install-ntpd</userinput></screen>
[dc6715a]260
[56ab82c]261 <para>If you prefer to run <command>ntpd</command> periodically, add the
262 following command to <systemitem class="username">root</systemitem>'s
[dc6715a]263 <filename>crontab</filename>:</para>
[56ab82c]264
[dc6715a]265<screen><literal>ntpd -q</literal></screen>
266
[7b478500]267 <para revision="sysv">Execute the following command if you would like to
268 set the hardware clock to the current system time at shutdown and
269 reboot:</para>
[dc6715a]270
[7b478500]271<screen role="root" revision="sysv"><userinput>ln -v -sf ../init.d/setclock /etc/rc.d/rc0.d/K46setclock &amp;&amp;
[e3353b3]272ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock</userinput></screen>
[dc6715a]273
[7b478500]274 <para revision="sysv">The other way around is already set up by
275 LFS.</para>
[56ab82c]276
[dc6715a]277 </sect3>
[56ab82c]278
[dc6715a]279 </sect2>
[56ab82c]280
[dc6715a]281 <sect2 role="content">
282 <title>Contents</title>
[56ab82c]283
[dc6715a]284 <segmentedlist>
285 <segtitle>Installed Programs</segtitle>
286 <segtitle>Installed Libraries</segtitle>
[78b797d]287 <segtitle>Installed Directories</segtitle>
[56ab82c]288
[dc6715a]289 <seglistitem>
[78b797d]290 <seg>calc_tickadj, ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
[ab6a3f3]291 ntptime, ntptrace, sntp, tickadj and update-leap</seg>
[dc6715a]292 <seg>None</seg>
[78b797d]293 <seg>/usr/share/ntp,
294 /usr/share/doc/ntp-4.2.8 and
295 /var/lib/ntp</seg>
[dc6715a]296 </seglistitem>
297 </segmentedlist>
[56ab82c]298
[dc6715a]299 <variablelist>
300 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
301 <?dbfo list-presentation="list"?>
302 <?dbhtml list-presentation="table"?>
[56ab82c]303
[78b797d]304 <varlistentry id="calc_tickadj">
305 <term><command>calc_tickadj</command></term>
306 <listitem>
307 <para>calculates optimal value for tick given ntp drift file.</para>
308 <indexterm zone="ntp calc_tickadj">
309 <primary sortas="b-calc_tickadj">calc_tickadj</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
[dc6715a]314 <varlistentry id="ntp-keygen">
315 <term><command>ntp-keygen</command></term>
316 <listitem>
[56ab82c]317 <para>generates cryptographic data files used by the NTPv4 authentication
[dc6715a]318 and identification schemes.</para>
319 <indexterm zone="ntp ntp-keygen">
320 <primary sortas="b-ntp-keygen">ntp-keygen</primary>
321 </indexterm>
322 </listitem>
323 </varlistentry>
[56ab82c]324
[dc6715a]325 <varlistentry id="ntp-wait">
326 <term><command>ntp-wait</command></term>
327 <listitem>
[56ab82c]328 <para>is useful at boot time, to delay the boot sequence until
[dc6715a]329 <command>ntpd</command> has set the time.</para>
330 <indexterm zone="ntp ntp-wait">
331 <primary sortas="b-ntp-wait">ntp-wait</primary>
332 </indexterm>
333 </listitem>
334 </varlistentry>
[56ab82c]335
[dc6715a]336 <varlistentry id="ntpd">
337 <term><command>ntpd</command></term>
338 <listitem>
[286c613d]339 <para>is a ntp daemon that runs in the background and keeps
[56ab82c]340 the date and time synchronized based on response from configured
[286c613d]341 ntp servers. It also functions as a ntp server.</para>
[dc6715a]342 <indexterm zone="ntp ntpd">
343 <primary sortas="b-ntpd">ntpd</primary>
344 </indexterm>
345 </listitem>
346 </varlistentry>
[56ab82c]347
[dc6715a]348 <varlistentry id="ntpdate">
349 <term><command>ntpdate</command></term>
350 <listitem>
[56ab82c]351 <para>is a client program that sets the date and time based on
[286c613d]352 the response from an ntp server. This command is deprecated.</para>
[dc6715a]353 <indexterm zone="ntp ntpdate">
354 <primary sortas="b-ntpdate">ntpdate</primary>
355 </indexterm>
356 </listitem>
357 </varlistentry>
[56ab82c]358
[dc6715a]359 <varlistentry id="ntpdc">
360 <term><command>ntpdc</command></term>
361 <listitem>
[286c613d]362 <para>is used to query the ntp daemon about its current state
[dc6715a]363 and to request changes in that state.</para>
364 <indexterm zone="ntp ntpdc">
365 <primary sortas="b-ntpdc">ntpdc</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
[56ab82c]369
[dc6715a]370 <varlistentry id="ntpq">
371 <term><command>ntpq</command></term>
372 <listitem>
[73fe507]373 <para>is a utility program used to monitor <command>ntpd</command>
[dc6715a]374 operations and determine performance.</para>
375 <indexterm zone="ntp ntpq">
376 <primary sortas="b-ntpq">ntpq</primary>
377 </indexterm>
378 </listitem>
379 </varlistentry>
[56ab82c]380
[dc6715a]381 <varlistentry id="ntptime">
382 <term><command>ntptime</command></term>
383 <listitem>
384 <para>reads and displays time-related kernel variables.</para>
385 <indexterm zone="ntp ntptime">
386 <primary sortas="b-ntptime">ntptime</primary>
387 </indexterm>
388 </listitem>
389 </varlistentry>
[56ab82c]390
[dc6715a]391 <varlistentry id="ntptrace">
392 <term><command>ntptrace</command></term>
393 <listitem>
[286c613d]394 <para>traces a chain of ntp servers back to the primary source.</para>
[dc6715a]395 <indexterm zone="ntp ntptrace">
[56ab82c]396 <primary sortas="b-ntptrace">ntptrace</primary>
[dc6715a]397 </indexterm>
398 </listitem>
399 </varlistentry>
[56ab82c]400
[36474cb]401 <varlistentry id="sntp">
402 <term><command>sntp</command></term>
403 <listitem>
404 <para>is a Simple Network Time Protocol (SNTP) client.</para>
405 <indexterm zone="ntp sntp">
406 <primary sortas="b-sntp">sntp</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
[dc6715a]411 <varlistentry id="tickadj">
412 <term><command>tickadj</command></term>
413 <listitem>
[56ab82c]414 <para>reads, and optionally modifies, several timekeeping-related
415 variables in older kernels that do not have support for precision
[dc6715a]416 timekeeping.</para>
417 <indexterm zone="ntp tickadj">
418 <primary sortas="b-tickadj">tickadj</primary>
419 </indexterm>
420 </listitem>
421 </varlistentry>
[56ab82c]422
[ab6a3f3]423 <varlistentry id="update-leap">
424 <term><command>update-leap</command></term>
425 <listitem>
426 <para>is a script to verify and, if necessary, update the leap-second
427 definition file.</para>
428 <indexterm zone="ntp update-leap">
429 <primary sortas="b-update-leap">update-leap</primary>
430 </indexterm>
431 </listitem>
432 </varlistentry>
433
[dc6715a]434 </variablelist>
[56ab82c]435
[dc6715a]436 </sect2>
[56ab82c]437
[39f01ca]438</sect1>
Note: See TracBrowser for help on using the repository browser.