source: networking/netprogs/ntp.xml@ 77882028

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt perl-modules 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 77882028 was 77882028, checked in by Thomas Trepl <thomas@…>, 6 years ago

Upgrade ntp-4.2.8p11

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

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