source: networking/netprogs/ntp.xml@ 94b42903

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.2 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 94b42903 was 94b42903, checked in by Bruce Dubbs <bdubbs@…>, 6 years ago

Archive openssl-1.1.x. Moved to LFS.
Update to v4l-utils-1.14.2.
Update to vlc-3.0.0.

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

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