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

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

More systemd integration merged from Christopher's branch.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@13503 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 &lfs75_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="libcap-pam"/>,
66 <xref linkend="openssl"/>, and
67 <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>
68 </para>
69
70 <para condition="html" role="usernotes">User Notes:
71 <ulink url="&blfs-wiki;/ntp"/></para>
72
73 </sect2>
74
75 <sect2 role="installation">
76 <title>Installation of ntp</title>
77
78 <para>
79 There should be a dedicated user and group to take control
80 of the <command>ntpd</command> daemon after it is
81 started. Issue the following commands as the
82 <systemitem class="username">root</systemitem> user:
83 </para>
84
85<screen role="root"><userinput>groupadd -g 87 ntp &amp;&amp;
86useradd -c "Network Time Protocol" -d /var/lib/ntp -u 87 \
87 -g ntp -s /bin/false ntp</userinput></screen>
88
89 <para>Install <application>ntp</application> by running
90 the following commands:</para>
91
92<screen><userinput>./configure --prefix=/usr \
93 --sysconfdir=/etc \
94 --enable-linuxcaps \
95 --with-binsubdir=sbin \
96 --with-lineeditlibs=readline &amp;&amp;
97make</userinput></screen>
98
99 <para>To test the results, issue: <command>make check</command>.</para>
100
101 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
102
103<screen role="root"><userinput>make install &amp;&amp;
104install -v -o ntp -g ntp -d /var/lib/ntp &amp;&amp;
105install -v -m755 -d /usr/share/doc/ntp-&ntp-version; &amp;&amp;
106cp -v -R html/* /usr/share/doc/ntp-&ntp-version;/</userinput></screen>
107
108 </sect2>
109
110 <sect2 role="commands">
111 <title>Command Explanations</title>
112
113 <para><parameter>--with-binsubdir=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 </sect3>
174
175 <sect3 id="ntp-init">
176 <title>Synchronizing the Time</title>
177
178 <para>There are two options. Option one is to run <command>ntpd</command>
179 continuously and allow it to synchronize the time in a gradual manner. The
180 other option is to run <command>ntpd</command> periodically (using cron)
181 and update the time each time <command>ntpd</command> is scheduled.</para>
182
183 <para>
184 To start the <command>ntpd</command> daemon at boot,
185 install the systemd unit from the <xref linkend="bootscripts"/>
186 package by running the following command as the
187 <systemitem class="username">root</systemitem> user:
188 </para>
189
190 <indexterm zone="ntp ntp-init">
191 <primary sortas="f-ntp">ntp</primary>
192 </indexterm>
193
194<screen role="root"><userinput>make install-ntpd</userinput></screen>
195
196 <para>If you prefer to run <command>ntpd</command> periodically, add the
197 following command to <systemitem class="username">root</systemitem>'s
198 <filename>crontab</filename>:</para>
199
200<screen><literal>ntpd -q</literal></screen>
201
202 </sect3>
203
204 </sect2>
205
206 <sect2 role="content">
207 <title>Contents</title>
208
209 <segmentedlist>
210 <segtitle>Installed Programs</segtitle>
211 <segtitle>Installed Libraries</segtitle>
212 <segtitle>Installed Directory</segtitle>
213
214 <seglistitem>
215 <seg>ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
216 ntptime, ntptrace, sntp and tickadj</seg>
217 <seg>None</seg>
218 <seg>/usr/share/doc/ntp-&ntp-version;</seg>
219 </seglistitem>
220 </segmentedlist>
221
222 <variablelist>
223 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
224 <?dbfo list-presentation="list"?>
225 <?dbhtml list-presentation="table"?>
226
227 <varlistentry id="ntp-keygen">
228 <term><command>ntp-keygen</command></term>
229 <listitem>
230 <para>generates cryptographic data files used by the NTPv4 authentication
231 and identification schemes.</para>
232 <indexterm zone="ntp ntp-keygen">
233 <primary sortas="b-ntp-keygen">ntp-keygen</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 <varlistentry id="ntp-wait">
239 <term><command>ntp-wait</command></term>
240 <listitem>
241 <para>is useful at boot time, to delay the boot sequence until
242 <command>ntpd</command> has set the time.</para>
243 <indexterm zone="ntp ntp-wait">
244 <primary sortas="b-ntp-wait">ntp-wait</primary>
245 </indexterm>
246 </listitem>
247 </varlistentry>
248
249 <varlistentry id="ntpd">
250 <term><command>ntpd</command></term>
251 <listitem>
252 <para>is a ntp daemon that runs in the background and keeps
253 the date and time synchronized based on response from configured
254 ntp servers. It also functions as a ntp server.</para>
255 <indexterm zone="ntp ntpd">
256 <primary sortas="b-ntpd">ntpd</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="ntpdate">
262 <term><command>ntpdate</command></term>
263 <listitem>
264 <para>is a client program that sets the date and time based on
265 the response from an ntp server. This command is deprecated.</para>
266 <indexterm zone="ntp ntpdate">
267 <primary sortas="b-ntpdate">ntpdate</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="ntpdc">
273 <term><command>ntpdc</command></term>
274 <listitem>
275 <para>is used to query the ntp daemon about its current state
276 and to request changes in that state.</para>
277 <indexterm zone="ntp ntpdc">
278 <primary sortas="b-ntpdc">ntpdc</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
282
283 <varlistentry id="ntpq">
284 <term><command>ntpq</command></term>
285 <listitem>
286 <para>is an utility program used to monitor <command>ntpd</command>
287 operations and determine performance.</para>
288 <indexterm zone="ntp ntpq">
289 <primary sortas="b-ntpq">ntpq</primary>
290 </indexterm>
291 </listitem>
292 </varlistentry>
293
294 <varlistentry id="ntptime">
295 <term><command>ntptime</command></term>
296 <listitem>
297 <para>reads and displays time-related kernel variables.</para>
298 <indexterm zone="ntp ntptime">
299 <primary sortas="b-ntptime">ntptime</primary>
300 </indexterm>
301 </listitem>
302 </varlistentry>
303
304 <varlistentry id="ntptrace">
305 <term><command>ntptrace</command></term>
306 <listitem>
307 <para>traces a chain of ntp servers back to the primary source.</para>
308 <indexterm zone="ntp ntptrace">
309 <primary sortas="b-ntptrace">ntptrace</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry id="sntp">
315 <term><command>sntp</command></term>
316 <listitem>
317 <para>is a Simple Network Time Protocol (SNTP) client.</para>
318 <indexterm zone="ntp sntp">
319 <primary sortas="b-sntp">sntp</primary>
320 </indexterm>
321 </listitem>
322 </varlistentry>
323
324 <varlistentry id="tickadj">
325 <term><command>tickadj</command></term>
326 <listitem>
327 <para>reads, and optionally modifies, several timekeeping-related
328 variables in older kernels that do not have support for precision
329 timekeeping.</para>
330 <indexterm zone="ntp tickadj">
331 <primary sortas="b-tickadj">tickadj</primary>
332 </indexterm>
333 </listitem>
334 </varlistentry>
335
336 </variablelist>
337
338 </sect2>
339
340</sect1>
Note: See TracBrowser for help on using the repository browser.