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