source: networking/netprogs/ntp.xml@ 04cb4e64

12.2 gimp3 lazarus trunk xry111/for-12.3 xry111/spidermonkey128
Last change on this file since 04cb4e64 was 04cb4e64, checked in by Thomas Trepl <thomas@…>, 4 months ago

Upgrade to ntp-4.2.8p18

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