source: networking/netprogs/ntp.xml@ 8dfc5c3

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.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 8dfc5c3 was 8dfc5c3, checked in by Krejzi <krejzi@…>, 7 years ago

Fix some URLs

  • Switch to https:// scheme where possible to avoid redirects
  • Unify all kernel.org, Sourceforge and GNU URLs
  • Fix python and perl module URLs to be consistent
  • Fix github provided URLs to properly download tarballs instead of vFOO.tar.gz
  • Use upstream locations for some packages or better/shorter URLs if available
  • Add https:// URLs for gnupg packages

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