source: networking/netprogs/ntp.xml@ 74a58ba

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 74a58ba was 74a58ba, checked in by Igor Živković <igor@…>, 10 years ago

classify libcap as recommended instead of required ntp dependency

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

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