source: networking/netprogs/ntp.xml@ 56d38b8

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.7 7.8 7.9 8.0 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 nosym 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 56d38b8 was 56d38b8, checked in by Bruce Dubbs <bdubbs@…>, 9 years ago

Finish postlfs section tags

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

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