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
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 "00950ca2855579541896513e78295361">
10 <!ENTITY ntp-size "11 MB">
11 <!ENTITY ntp-buildsize "102 MB (with tests)">
12 <!ENTITY ntp-time "0.8 SBU (with tests)">
13]>
14
15<sect1 id="ntp" xreflabel="ntp-&ntp-version;">
16 <?dbhtml filename="ntp.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>ntp-&ntp-version;</title>
24
25 <indexterm zone="ntp">
26 <primary sortas="a-ntp">ntp</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to ntp</title>
31
32 <para>The <application>ntp</application> package contains a
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
35 NTP protocol.</para>
36
37 &lfs82_checked;
38
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>
57 <para>Estimated build time: &ntp-time;</para>
58 </listitem>
59 </itemizedlist>
60
61 <bridgehead renderas="sect3">ntp Dependencies</bridgehead>
62
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.
71 <bridgehead renderas="sect4">Recommended</bridgehead>
72 <para role="recommended">
73 <xref role="runtime" linkend="wget"/> (runtime, for
74 <command>update-leap</command>)
75<!- - The download code for update-leap uses the File::Fetch perl module,
76 which may use wget, or lynx, or some core perl modules, so maybe move
77 to optional - ->
78 </para>
79-->
80 <bridgehead renderas="sect4">Optional</bridgehead>
81 <para role="optional">
82 <xref linkend="libcap-pam"/>,
83 <xref linkend="libevent"/>,
84 <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>, and
85 <ulink url="https://www.gnu.org/software/autogen/">libopts from AutoGen</ulink>
86 </para>
87
88 <para condition="html" role="usernotes">User Notes:
89 <ulink url="&blfs-wiki;/ntp"/></para>
90
91 </sect2>
92
93 <sect2 role="installation">
94 <title>Installation of ntp</title>
95
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
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
114<screen><userinput>sed -e 's/"(\\S+)"/"?([^\\s"]+)"?/' \
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>
121
122<screen><userinput>./configure CFLAGS="-O2 -g -fPIC" \
123 --prefix=/usr \
124 --bindir=/usr/sbin \
125 --sysconfdir=/etc \
126 --enable-linuxcaps \
127 --with-lineeditlibs=readline \
128 --docdir=/usr/share/doc/ntp-&ntp-version; &amp;&amp;
129make</userinput></screen>
130
131 <para>
132 To test the results, issue: <command>make check</command>.
133 </para>
134
135 <para>
136 Now, as the <systemitem class="username">root</systemitem> user:
137 </para>
138
139<screen role="root"><userinput>make install &amp;&amp;
140install -v -o ntp -g ntp -d /var/lib/ntp</userinput></screen>
141
142 </sect2>
143
144 <sect2 role="commands">
145 <title>Command Explanations</title>
146
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
151 <para><parameter>--bindir=/usr/sbin</parameter>: This parameter places
152 the administrative programs in <filename
153 class="directory">/usr/sbin</filename>.</para>
154
155 <para><parameter>--enable-linuxcaps</parameter>: ntpd is run as user
156 ntp, so use Linux capabilities for non-root clock control.</para>
157
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,
161 <application>libedit</application> will be used if installed, otherwise no
162 readline capabilites will be compiled.</para>
163
164 </sect2>
165
166 <sect2 role="configuration">
167 <title>Configuring ntp</title>
168
169 <sect3 id="ntp-config">
170 <title>Config Files</title>
171
172 <para><filename>/etc/ntp.conf</filename></para>
173
174 <indexterm zone="ntp ntp-config">
175 <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
176 </indexterm>
177
178 </sect3>
179
180 <sect3>
181 <title>Configuration Information</title>
182
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
196 <ulink url="http://www.pool.ntp.org/"/> for more information.</para>
197
198<screen role="root"><userinput>cat &gt; /etc/ntp.conf &lt;&lt; "EOF"
199<literal># Asia
200server 0.asia.pool.ntp.org
201
202# Australia
203server 0.oceania.pool.ntp.org
204
205# Europe
206server 0.europe.pool.ntp.org
207
208# North America
209server 0.north-america.pool.ntp.org
210
211# South America
212server 2.south-america.pool.ntp.org
213
214driftfile /var/lib/ntp/ntp.drift
215pidfile /var/run/ntpd.pid
216
217leapfile /etc/ntp.leapseconds</literal>
218EOF</userinput></screen>
219
220 <para>
221 You may wish to add a <quote>Security session</quote>. For
222 explanations, see
223 <ulink url="https://www.eecis.udel.edu/~mills/ntp/html/accopt.html#restrict"/>.
224 </para>
225
226<screen role="root"><userinput>cat &gt;&gt; /etc/ntp.conf &lt;&lt; "EOF"
227<literal># Security session
228restrict default limited kod nomodify notrap nopeer noquery
229restrict -6 default limited kod nomodify notrap nopeer noquery
230
231restrict 127.0.0.1
232restrict ::1</literal>
233EOF</userinput></screen>
234
235 </sect3>
236
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>
241 continuously and allow it to synchronize the time in a gradual manner. The
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>
244
245 <para>If you choose Option one, then install the
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
250 <xref linkend="bootscripts" revision="sysv"/>
251 <xref linkend="systemd-units" revision="systemd"/> package.</para>
252
253 <indexterm zone="ntp ntp-init" revision="sysv">
254 <primary sortas="f-ntp">ntp</primary>
255 </indexterm>
256
257 <indexterm zone="ntp ntp-init" revision="systemd">
258 <primary sortas="f-ntpd">ntpd.service</primary>
259 </indexterm>
260
261<screen role="root"><userinput>make install-ntpd</userinput></screen>
262
263 <para>If you prefer to run <command>ntpd</command> periodically, add the
264 following command to <systemitem class="username">root</systemitem>'s
265 <filename>crontab</filename>:</para>
266
267<screen><literal>ntpd -q</literal></screen>
268
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>
272
273<screen role="root" revision="sysv"><userinput>ln -v -sf ../init.d/setclock /etc/rc.d/rc0.d/K46setclock &amp;&amp;
274ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock</userinput></screen>
275
276 <para revision="sysv">The other way around is already set up by
277 LFS.</para>
278
279 </sect3>
280
281 </sect2>
282
283 <sect2 role="content">
284 <title>Contents</title>
285
286 <segmentedlist>
287 <segtitle>Installed Programs</segtitle>
288 <segtitle>Installed Libraries</segtitle>
289 <segtitle>Installed Directories</segtitle>
290
291 <seglistitem>
292 <seg>calc_tickadj, ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
293 ntptime, ntptrace, sntp, tickadj and update-leap</seg>
294 <seg>None</seg>
295 <seg>/usr/share/ntp,
296 /usr/share/doc/ntp-4.2.8 and
297 /var/lib/ntp</seg>
298 </seglistitem>
299 </segmentedlist>
300
301 <variablelist>
302 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
303 <?dbfo list-presentation="list"?>
304 <?dbhtml list-presentation="table"?>
305
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
316 <varlistentry id="ntp-keygen">
317 <term><command>ntp-keygen</command></term>
318 <listitem>
319 <para>generates cryptographic data files used by the NTPv4 authentication
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>
326
327 <varlistentry id="ntp-wait">
328 <term><command>ntp-wait</command></term>
329 <listitem>
330 <para>is useful at boot time, to delay the boot sequence until
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>
337
338 <varlistentry id="ntpd">
339 <term><command>ntpd</command></term>
340 <listitem>
341 <para>is a ntp daemon that runs in the background and keeps
342 the date and time synchronized based on response from configured
343 ntp servers. It also functions as a ntp server.</para>
344 <indexterm zone="ntp ntpd">
345 <primary sortas="b-ntpd">ntpd</primary>
346 </indexterm>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry id="ntpdate">
351 <term><command>ntpdate</command></term>
352 <listitem>
353 <para>is a client program that sets the date and time based on
354 the response from an ntp server. This command is deprecated.</para>
355 <indexterm zone="ntp ntpdate">
356 <primary sortas="b-ntpdate">ntpdate</primary>
357 </indexterm>
358 </listitem>
359 </varlistentry>
360
361 <varlistentry id="ntpdc">
362 <term><command>ntpdc</command></term>
363 <listitem>
364 <para>is used to query the ntp daemon about its current state
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>
371
372 <varlistentry id="ntpq">
373 <term><command>ntpq</command></term>
374 <listitem>
375 <para>is a utility program used to monitor <command>ntpd</command>
376 operations and determine performance.</para>
377 <indexterm zone="ntp ntpq">
378 <primary sortas="b-ntpq">ntpq</primary>
379 </indexterm>
380 </listitem>
381 </varlistentry>
382
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>
392
393 <varlistentry id="ntptrace">
394 <term><command>ntptrace</command></term>
395 <listitem>
396 <para>traces a chain of ntp servers back to the primary source.</para>
397 <indexterm zone="ntp ntptrace">
398 <primary sortas="b-ntptrace">ntptrace</primary>
399 </indexterm>
400 </listitem>
401 </varlistentry>
402
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
413 <varlistentry id="tickadj">
414 <term><command>tickadj</command></term>
415 <listitem>
416 <para>reads, and optionally modifies, several timekeeping-related
417 variables in older kernels that do not have support for precision
418 timekeeping.</para>
419 <indexterm zone="ntp tickadj">
420 <primary sortas="b-tickadj">tickadj</primary>
421 </indexterm>
422 </listitem>
423 </varlistentry>
424
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
436 </variablelist>
437
438 </sect2>
439
440</sect1>
Note: See TracBrowser for help on using the repository browser.