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 "fa37049383316322d060ec9061ac23a9">
|
---|
11 | <!ENTITY ntp-size "6.6 MB">
|
---|
12 | <!ENTITY ntp-buildsize "70 MB">
|
---|
13 | <!ENTITY ntp-time "0.5 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="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="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/">AutoGen</ulink>
|
---|
76 | </para>
|
---|
77 |
|
---|
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>This package does not have a working testsuite.</para>
|
---|
112 |
|
---|
113 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
114 |
|
---|
115 | <screen role="root"><userinput>make install &&
|
---|
116 | install -v -dm755 -o ntp -g ntp /var/lib/ntp</userinput></screen>
|
---|
117 |
|
---|
118 | </sect2>
|
---|
119 |
|
---|
120 | <sect2 role="commands">
|
---|
121 | <title>Command Explanations</title>
|
---|
122 |
|
---|
123 | <para><parameter>--bindir=/usr/sbin</parameter>: This parameter places
|
---|
124 | the administrative programs in <filename
|
---|
125 | class="directory">/usr/sbin</filename>.</para>
|
---|
126 |
|
---|
127 | <para><parameter>--enable-linuxcaps</parameter>: ntpd is run as user
|
---|
128 | ntp, so use Linux capabilities for non-root clock control.</para>
|
---|
129 |
|
---|
130 | <para><option>--with-lineeditlibs=readline</option>: This option enables
|
---|
131 | <application>Readline</application> support for <command>ntpdc</command>
|
---|
132 | and <command>ntpq</command> programs. If omitted,
|
---|
133 | <application>libedit</application> will be used if installed, otherwise no
|
---|
134 | readline capabilites will be compiled.</para>
|
---|
135 |
|
---|
136 | </sect2>
|
---|
137 |
|
---|
138 | <sect2 role="configuration">
|
---|
139 | <title>Configuring ntp</title>
|
---|
140 |
|
---|
141 | <sect3 id="ntp-config">
|
---|
142 | <title>Config Files</title>
|
---|
143 |
|
---|
144 | <para><filename>/etc/ntp.conf</filename></para>
|
---|
145 |
|
---|
146 | <indexterm zone="ntp ntp-config">
|
---|
147 | <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
|
---|
148 | </indexterm>
|
---|
149 |
|
---|
150 | </sect3>
|
---|
151 |
|
---|
152 | <sect3>
|
---|
153 | <title>Configuration Information</title>
|
---|
154 |
|
---|
155 | <para>The following configuration file first defines various ntp
|
---|
156 | servers with open access from different continents. Second, it
|
---|
157 | creates a drift file where <command>ntpd</command> stores the
|
---|
158 | frequency offset and a pid file to store the
|
---|
159 | <command>ntpd</command> process ID. Third, it defines the location
|
---|
160 | for the leap-second definition file
|
---|
161 | <filename>/etc/ntp.leapseconds</filename>, that the
|
---|
162 | <command>update-leap</command> script checks and updates when
|
---|
163 | necessary. This script can be run as a cron job and the
|
---|
164 | <application>ntp</application> developers recommend a frequency of
|
---|
165 | about three weeks for the updates. Since the documentation included
|
---|
166 | with the package is sparse, visit the ntp website at
|
---|
167 | <ulink url="http://www.ntp.org/"/> and
|
---|
168 | <ulink url="http://www.pool.ntp.org/"/> for more information.</para>
|
---|
169 |
|
---|
170 | <screen role="root"><userinput>cat > /etc/ntp.conf << "EOF"
|
---|
171 | <literal># Asia
|
---|
172 | server 0.asia.pool.ntp.org
|
---|
173 |
|
---|
174 | # Australia
|
---|
175 | server 0.oceania.pool.ntp.org
|
---|
176 |
|
---|
177 | # Europe
|
---|
178 | server 0.europe.pool.ntp.org
|
---|
179 |
|
---|
180 | # North America
|
---|
181 | server 0.north-america.pool.ntp.org
|
---|
182 |
|
---|
183 | # South America
|
---|
184 | server 2.south-america.pool.ntp.org
|
---|
185 |
|
---|
186 | driftfile /var/lib/ntp/ntp.drift
|
---|
187 | pidfile /var/run/ntpd.pid
|
---|
188 |
|
---|
189 | leapfile /etc/ntp.leapseconds</literal>
|
---|
190 | EOF</userinput></screen>
|
---|
191 |
|
---|
192 | <para>
|
---|
193 | For security reasons, you may wish to extend the configuration
|
---|
194 | file according to <ulink
|
---|
195 | url="https://www.eecis.udel.edu/~mills/ntp/html/accopt.html#restrict"/>.
|
---|
196 | </para>
|
---|
197 |
|
---|
198 | <screen role="root"><userinput>cat >> /etc/ntp.conf << "EOF"
|
---|
199 | <literal># Security session
|
---|
200 | restrict default limited kod nomodify notrap nopeer noquery
|
---|
201 | restrict -6 default limited kod nomodify notrap nopeer noquery
|
---|
202 |
|
---|
203 | restrict 127.0.0.1
|
---|
204 | restrict ::1</literal>
|
---|
205 | EOF</userinput></screen>
|
---|
206 |
|
---|
207 | </sect3>
|
---|
208 |
|
---|
209 | <sect3 id="ntp-init">
|
---|
210 | <title>Synchronizing the Time</title>
|
---|
211 |
|
---|
212 | <para>There are two options. Option one is to run <command>ntpd</command>
|
---|
213 | continuously and allow it to synchronize the time in a gradual manner. The
|
---|
214 | other option is to run <command>ntpd</command> periodically (using cron)
|
---|
215 | and update the time each time <command>ntpd</command> is scheduled.</para>
|
---|
216 |
|
---|
217 | <para>
|
---|
218 | To start the <command>ntpd</command> daemon at boot,
|
---|
219 | install the systemd unit from the <xref linkend="bootscripts"/>
|
---|
220 | package by running the following command as the
|
---|
221 | <systemitem class="username">root</systemitem> user:
|
---|
222 | </para>
|
---|
223 |
|
---|
224 | <indexterm zone="ntp ntp-init">
|
---|
225 | <primary sortas="f-ntp">ntp</primary>
|
---|
226 | </indexterm>
|
---|
227 |
|
---|
228 | <screen role="root"><userinput>make install-ntpd</userinput></screen>
|
---|
229 |
|
---|
230 | <para>If you prefer to run <command>ntpd</command> periodically, add the
|
---|
231 | following command to <systemitem class="username">root</systemitem>'s
|
---|
232 | <filename>crontab</filename>:</para>
|
---|
233 |
|
---|
234 | <screen><literal>ntpd -q</literal></screen>
|
---|
235 |
|
---|
236 | </sect3>
|
---|
237 |
|
---|
238 | </sect2>
|
---|
239 |
|
---|
240 | <sect2 role="content">
|
---|
241 | <title>Contents</title>
|
---|
242 |
|
---|
243 | <segmentedlist>
|
---|
244 | <segtitle>Installed Programs</segtitle>
|
---|
245 | <segtitle>Installed Libraries</segtitle>
|
---|
246 | <segtitle>Installed Directories</segtitle>
|
---|
247 |
|
---|
248 | <seglistitem>
|
---|
249 | <seg>calc_tickadj, ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
|
---|
250 | ntptime, ntptrace, sntp, tickadj and update-leap</seg>
|
---|
251 | <seg>None</seg>
|
---|
252 | <seg>/usr/share/ntp,
|
---|
253 | /usr/share/doc/ntp-4.2.8 and
|
---|
254 | /var/lib/ntp</seg>
|
---|
255 | </seglistitem>
|
---|
256 | </segmentedlist>
|
---|
257 |
|
---|
258 | <variablelist>
|
---|
259 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
260 | <?dbfo list-presentation="list"?>
|
---|
261 | <?dbhtml list-presentation="table"?>
|
---|
262 |
|
---|
263 | <varlistentry id="calc_tickadj">
|
---|
264 | <term><command>calc_tickadj</command></term>
|
---|
265 | <listitem>
|
---|
266 | <para>calculates optimal value for tick given ntp drift file.</para>
|
---|
267 | <indexterm zone="ntp calc_tickadj">
|
---|
268 | <primary sortas="b-calc_tickadj">calc_tickadj</primary>
|
---|
269 | </indexterm>
|
---|
270 | </listitem>
|
---|
271 | </varlistentry>
|
---|
272 |
|
---|
273 | <varlistentry id="ntp-keygen">
|
---|
274 | <term><command>ntp-keygen</command></term>
|
---|
275 | <listitem>
|
---|
276 | <para>generates cryptographic data files used by the NTPv4 authentication
|
---|
277 | and identification schemes.</para>
|
---|
278 | <indexterm zone="ntp ntp-keygen">
|
---|
279 | <primary sortas="b-ntp-keygen">ntp-keygen</primary>
|
---|
280 | </indexterm>
|
---|
281 | </listitem>
|
---|
282 | </varlistentry>
|
---|
283 |
|
---|
284 | <varlistentry id="ntp-wait">
|
---|
285 | <term><command>ntp-wait</command></term>
|
---|
286 | <listitem>
|
---|
287 | <para>is useful at boot time, to delay the boot sequence until
|
---|
288 | <command>ntpd</command> has set the time.</para>
|
---|
289 | <indexterm zone="ntp ntp-wait">
|
---|
290 | <primary sortas="b-ntp-wait">ntp-wait</primary>
|
---|
291 | </indexterm>
|
---|
292 | </listitem>
|
---|
293 | </varlistentry>
|
---|
294 |
|
---|
295 | <varlistentry id="ntpd">
|
---|
296 | <term><command>ntpd</command></term>
|
---|
297 | <listitem>
|
---|
298 | <para>is a ntp daemon that runs in the background and keeps
|
---|
299 | the date and time synchronized based on response from configured
|
---|
300 | ntp servers. It also functions as a ntp server.</para>
|
---|
301 | <indexterm zone="ntp ntpd">
|
---|
302 | <primary sortas="b-ntpd">ntpd</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | <varlistentry id="ntpdate">
|
---|
308 | <term><command>ntpdate</command></term>
|
---|
309 | <listitem>
|
---|
310 | <para>is a client program that sets the date and time based on
|
---|
311 | the response from an ntp server. This command is deprecated.</para>
|
---|
312 | <indexterm zone="ntp ntpdate">
|
---|
313 | <primary sortas="b-ntpdate">ntpdate</primary>
|
---|
314 | </indexterm>
|
---|
315 | </listitem>
|
---|
316 | </varlistentry>
|
---|
317 |
|
---|
318 | <varlistentry id="ntpdc">
|
---|
319 | <term><command>ntpdc</command></term>
|
---|
320 | <listitem>
|
---|
321 | <para>is used to query the ntp daemon about its current state
|
---|
322 | and to request changes in that state.</para>
|
---|
323 | <indexterm zone="ntp ntpdc">
|
---|
324 | <primary sortas="b-ntpdc">ntpdc</primary>
|
---|
325 | </indexterm>
|
---|
326 | </listitem>
|
---|
327 | </varlistentry>
|
---|
328 |
|
---|
329 | <varlistentry id="ntpq">
|
---|
330 | <term><command>ntpq</command></term>
|
---|
331 | <listitem>
|
---|
332 | <para>is a utility program used to monitor <command>ntpd</command>
|
---|
333 | operations and determine performance.</para>
|
---|
334 | <indexterm zone="ntp ntpq">
|
---|
335 | <primary sortas="b-ntpq">ntpq</primary>
|
---|
336 | </indexterm>
|
---|
337 | </listitem>
|
---|
338 | </varlistentry>
|
---|
339 |
|
---|
340 | <varlistentry id="ntptime">
|
---|
341 | <term><command>ntptime</command></term>
|
---|
342 | <listitem>
|
---|
343 | <para>reads and displays time-related kernel variables.</para>
|
---|
344 | <indexterm zone="ntp ntptime">
|
---|
345 | <primary sortas="b-ntptime">ntptime</primary>
|
---|
346 | </indexterm>
|
---|
347 | </listitem>
|
---|
348 | </varlistentry>
|
---|
349 |
|
---|
350 | <varlistentry id="ntptrace">
|
---|
351 | <term><command>ntptrace</command></term>
|
---|
352 | <listitem>
|
---|
353 | <para>traces a chain of ntp servers back to the primary source.</para>
|
---|
354 | <indexterm zone="ntp ntptrace">
|
---|
355 | <primary sortas="b-ntptrace">ntptrace</primary>
|
---|
356 | </indexterm>
|
---|
357 | </listitem>
|
---|
358 | </varlistentry>
|
---|
359 |
|
---|
360 | <varlistentry id="sntp">
|
---|
361 | <term><command>sntp</command></term>
|
---|
362 | <listitem>
|
---|
363 | <para>is a Simple Network Time Protocol (SNTP) client.</para>
|
---|
364 | <indexterm zone="ntp sntp">
|
---|
365 | <primary sortas="b-sntp">sntp</primary>
|
---|
366 | </indexterm>
|
---|
367 | </listitem>
|
---|
368 | </varlistentry>
|
---|
369 |
|
---|
370 | <varlistentry id="tickadj">
|
---|
371 | <term><command>tickadj</command></term>
|
---|
372 | <listitem>
|
---|
373 | <para>reads, and optionally modifies, several timekeeping-related
|
---|
374 | variables in older kernels that do not have support for precision
|
---|
375 | timekeeping.</para>
|
---|
376 | <indexterm zone="ntp tickadj">
|
---|
377 | <primary sortas="b-tickadj">tickadj</primary>
|
---|
378 | </indexterm>
|
---|
379 | </listitem>
|
---|
380 | </varlistentry>
|
---|
381 |
|
---|
382 | <varlistentry id="update-leap">
|
---|
383 | <term><command>update-leap</command></term>
|
---|
384 | <listitem>
|
---|
385 | <para>is a script to verify and, if necessary, update the leap-second
|
---|
386 | definition file.</para>
|
---|
387 | <indexterm zone="ntp update-leap">
|
---|
388 | <primary sortas="b-update-leap">update-leap</primary>
|
---|
389 | </indexterm>
|
---|
390 | </listitem>
|
---|
391 | </varlistentry>
|
---|
392 |
|
---|
393 | </variablelist>
|
---|
394 |
|
---|
395 | </sect2>
|
---|
396 |
|
---|
397 | </sect1>
|
---|