source: networking/netprogs/ntp-systemd.xml@ e680d14a

systemd-11177
Last change on this file since e680d14a was e680d14a, checked in by Krejzi <krejzi@…>, 10 years ago

Checks and fixes.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@14078 af4574ff-66df-0310-9fd7-8a98e5e911e0

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