source: networking/netprogs/ntp.xml@ 9da4cc6f

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 9da4cc6f was 4d56869, checked in by Bruce Dubbs <bdubbs@…>, 6 years ago

Use LWP::Protocol::https for ntp dependency.
Update to hdparm-9.56.

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

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