source: networking/netprogs/ntp.xml@ eecae1f9

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 eecae1f9 was eecae1f9, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Update to ntp-4.2.8p10.
python3-3.6.1.

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

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