source: networking/netprogs/ntp.xml@ 095d076

11.0 11.1 11.2 11.3 12.0 12.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 095d076 was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 3 years ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

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