source: networking/netprogs/ntp.xml@ 8af694bb

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 8af694bb was 3776752, checked in by Ken Moffat <ken@…>, 9 years ago

Tags for gcc-5: this small batch were tested using the 5.1.0 compiler, there is still time for people to object on -dev about my intention to tag things I've tested with -rc. Also, I assume these tags are intended to be additional to the 7.7 tags ?

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

  • Property mode set to 100644
File size: 13.5 KB
RevLine 
[d47e7ea9]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[d47e7ea9]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[f4a1b66]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 " ">
[ab6a3f3]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">
[d47e7ea9]14]>
15
[286c613d]16<sect1 id="ntp" xreflabel="ntp-&ntp-version;">
[dc6715a]17 <?dbhtml filename="ntp.html"?>
[56ab82c]18
[dc6715a]19 <sect1info>
20 <othername>$LastChangedBy$</othername>
21 <date>$Date$</date>
22 </sect1info>
[56ab82c]23
[286c613d]24 <title>ntp-&ntp-version;</title>
[56ab82c]25
[dc6715a]26 <indexterm zone="ntp">
[286c613d]27 <primary sortas="a-ntp">ntp</primary>
[dc6715a]28 </indexterm>
29
30 <sect2 role="package">
[286c613d]31 <title>Introduction to ntp</title>
[56ab82c]32
[286c613d]33 <para>The <application>ntp</application> package contains a
[56ab82c]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
[dc6715a]36 NTP protocol.</para>
[56ab82c]37
[3776752]38 &lfs77_checked; &gcc5_checked;
[6564aa1]39
[dc6715a]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>
[2174baa]58 <para>Estimated build time: &ntp-time;</para>
59 </listitem>
[dc6715a]60 </itemizedlist>
[56ab82c]61
[286c613d]62 <bridgehead renderas="sect3">ntp Dependencies</bridgehead>
[56ab82c]63
[e3cbfaf]64 <bridgehead renderas="sect4">Required</bridgehead>
65 <para role="required">
[ab6a3f3]66 <xref linkend="wget"/> (runtime, for <command>update-leap</command>) and
[e3cbfaf]67 <xref linkend="which"/>
68 </para>
69
[dc6715a]70 <bridgehead renderas="sect4">Optional</bridgehead>
[03f32bb]71 <para role="optional">
[56605b9]72 <xref linkend="libcap-pam"/>,
[e3cbfaf]73 <xref linkend="libevent"/>,
74 <xref linkend="openssl"/>,
75 <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>, and
76 <ulink url="https://www.gnu.org/software/autogen/">libopts from
77 AutoGen</ulink>
[03f32bb]78 </para>
[56ab82c]79
[061ec9d]80 <para condition="html" role="usernotes">User Notes:
81 <ulink url="&blfs-wiki;/ntp"/></para>
82
[dc6715a]83 </sect2>
[56ab82c]84
[dc6715a]85 <sect2 role="installation">
[286c613d]86 <title>Installation of ntp</title>
[dc6715a]87
[e38cfca]88 <para>
89 There should be a dedicated user and group to take control
90 of the <command>ntpd</command> daemon after it is
91 started. Issue the following commands as the
92 <systemitem class="username">root</systemitem> user:
93 </para>
94
95<screen role="root"><userinput>groupadd -g 87 ntp &amp;&amp;
96useradd -c "Network Time Protocol" -d /var/lib/ntp -u 87 \
97 -g ntp -s /bin/false ntp</userinput></screen>
98
[286c613d]99 <para>Install <application>ntp</application> by running
[dc6715a]100 the following commands:</para>
101
[f82ac3f]102<screen><userinput>./configure --prefix=/usr \
[78b797d]103 --bindir=/usr/sbin \
[2dcc08c0]104 --sysconfdir=/etc \
105 --enable-linuxcaps \
[78b797d]106 --with-lineeditlibs=readline \
107 --docdir=/usr/share/doc/ntp-&ntp-version; &amp;&amp;
[11cf9f2]108make</userinput></screen>
109
[ab6a3f3]110<!-- <para>To test the results, issue: <command>make check</command>.</para>
111-->
112 <para>This package does not come with a useful test suite.</para>
[56ab82c]113
[11cf9f2]114 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
[56ab82c]115
[339fbfb9]116<screen role="root"><userinput>make install &amp;&amp;
[78b797d]117install -v -o ntp -g ntp -d /var/lib/ntp</userinput></screen>
[36474cb]118
119 </sect2>
120
121 <sect2 role="commands">
122 <title>Command Explanations</title>
123
[78b797d]124 <para><parameter>--bindir=/usr/sbin</parameter>: This parameter places
[36474cb]125 the administrative programs in <filename
126 class="directory">/usr/sbin</filename>.</para>
[11cf9f2]127
[2dcc08c0]128 <para><parameter>--enable-linuxcaps</parameter>: ntpd is run as user
129 ntp, so use Linux capabilities for non-root clock control.</para>
130
[a01b1bf]131 <para><option>--with-lineeditlibs=readline</option>: This option enables
132 <application>Readline</application> support for <command>ntpdc</command>
133 and <command>ntpq</command> programs. If omitted,
134 <application>libedit</application> will be used if installed, otherwise no
135 readline capabilites will be compiled.</para>
136
[dc6715a]137 </sect2>
[56ab82c]138
[dc6715a]139 <sect2 role="configuration">
[286c613d]140 <title>Configuring ntp</title>
[56ab82c]141
[dc6715a]142 <sect3 id="ntp-config">
143 <title>Config Files</title>
[56ab82c]144
[dc6715a]145 <para><filename>/etc/ntp.conf</filename></para>
[56ab82c]146
[dc6715a]147 <indexterm zone="ntp ntp-config">
148 <primary sortas="e-etc-ntp.conf">/etc/ntp.conf</primary>
149 </indexterm>
[56ab82c]150
[dc6715a]151 </sect3>
[56ab82c]152
[dc6715a]153 <sect3>
154 <title>Configuration Information</title>
155
[ab6a3f3]156 <para>The following configuration file first defines various ntp
157 servers with open access from different continents. Second, it
158 creates a drift file where <command>ntpd</command> stores the
159 frequency offset and a pid file to store the
160 <command>ntpd</command> process ID. Third, it defines the location
161 for the leap-second definition file
162 <filename>/etc/ntp.leapseconds</filename>, that the
163 <command>update-leap</command> script checks and updates, when
164 necessary. This script can be run as a cron job and the
165 <application>ntp</application> developers recommend a frequency of
166 about three weeks for the updates. Since the documentation included
167 with the package is sparse, visit the ntp website at
168 <ulink url="http://www.ntp.org/"/> and
[a88b03e]169 <ulink url="http://www.pool.ntp.org/"/> for more information.</para>
[dc6715a]170
171<screen role="root"><userinput>cat &gt; /etc/ntp.conf &lt;&lt; "EOF"
[6e26273]172<literal># Asia
[bca6dfb6]173server 0.asia.pool.ntp.org
[d47e7ea9]174
175# Australia
[bca6dfb6]176server 0.oceania.pool.ntp.org
[56ab82c]177
[d47e7ea9]178# Europe
[ea57941f]179server 0.europe.pool.ntp.org
[d47e7ea9]180
181# North America
[ea57941f]182server 0.north-america.pool.ntp.org
183
184# South America
[bca6dfb6]185server 2.south-america.pool.ntp.org
[d47e7ea9]186
[1e72251e]187driftfile /var/lib/ntp/ntp.drift
[ab6a3f3]188pidfile /var/run/ntpd.pid
189
190leapfile /etc/ntp.leapseconds</literal>
[78b797d]191EOF</userinput></screen>
192
[39159bf]193 <para>
194 You may wish to add a <quote>Security session</quote>. For
195 explanations, see
[f4a1b66]196 <ulink url="https://www.eecis.udel.edu/~mills/ntp/html/accopt.html#restrict"/>.
[39159bf]197 </para>
[78b797d]198
199<screen role="root"><userinput>cat &gt;&gt; /etc/ntp.conf &lt;&lt; "EOF"
200<literal># Security session
201restrict default limited kod nomodify notrap nopeer noquery
202restrict -6 default limited kod nomodify notrap nopeer noquery
203
204restrict 127.0.0.1
205restrict ::1</literal>
[dc6715a]206EOF</userinput></screen>
207
208 </sect3>
[56ab82c]209
[dc6715a]210 <sect3 id="ntp-init">
211 <title>Synchronizing the Time</title>
212
213 <para>There are two options. Option one is to run <command>ntpd</command>
[56ab82c]214 continuously and allow it to synchronize the time in a gradual manner. The
[dc6715a]215 other option is to run <command>ntpd</command> periodically (using cron)
216 and update the time each time <command>ntpd</command> is scheduled.</para>
[56ab82c]217
218 <para>If you choose Option one, then install the
[dc6715a]219 <filename>/etc/rc.d/init.d/ntp</filename>
220 init script included in the
[5254d12]221 <xref linkend="bootscripts"/> package.</para>
[56ab82c]222
223 <indexterm zone="ntp ntp-init">
[dc6715a]224 <primary sortas="f-ntp">ntp</primary>
[56ab82c]225 </indexterm>
[dc6715a]226
[286c613d]227<screen role="root"><userinput>make install-ntpd</userinput></screen>
[dc6715a]228
[56ab82c]229 <para>If you prefer to run <command>ntpd</command> periodically, add the
230 following command to <systemitem class="username">root</systemitem>'s
[dc6715a]231 <filename>crontab</filename>:</para>
[56ab82c]232
[dc6715a]233<screen><literal>ntpd -q</literal></screen>
234
235 <para>Execute the following command if you would like to set the
[339fbfb9]236 hardware clock to the current system time at shutdown and reboot:</para>
[dc6715a]237
[e3353b3]238<screen role="root"><userinput>ln -v -sf ../init.d/setclock /etc/rc.d/rc0.d/K46setclock &amp;&amp;
239ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock</userinput></screen>
[dc6715a]240
241 <para>The other way around is already set up by LFS.</para>
[56ab82c]242
[dc6715a]243 </sect3>
[56ab82c]244
[dc6715a]245 </sect2>
[56ab82c]246
[dc6715a]247 <sect2 role="content">
248 <title>Contents</title>
[56ab82c]249
[dc6715a]250 <segmentedlist>
251 <segtitle>Installed Programs</segtitle>
252 <segtitle>Installed Libraries</segtitle>
[78b797d]253 <segtitle>Installed Directories</segtitle>
[56ab82c]254
[dc6715a]255 <seglistitem>
[78b797d]256 <seg>calc_tickadj, ntp-keygen, ntp-wait, ntpd, ntpdate, ntpdc, ntpq,
[ab6a3f3]257 ntptime, ntptrace, sntp, tickadj and update-leap</seg>
[dc6715a]258 <seg>None</seg>
[78b797d]259 <seg>/usr/share/ntp,
260 /usr/share/doc/ntp-4.2.8 and
261 /var/lib/ntp</seg>
[dc6715a]262 </seglistitem>
263 </segmentedlist>
[56ab82c]264
[dc6715a]265 <variablelist>
266 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
267 <?dbfo list-presentation="list"?>
268 <?dbhtml list-presentation="table"?>
[56ab82c]269
[78b797d]270 <varlistentry id="calc_tickadj">
271 <term><command>calc_tickadj</command></term>
272 <listitem>
273 <para>calculates optimal value for tick given ntp drift file.</para>
274 <indexterm zone="ntp calc_tickadj">
275 <primary sortas="b-calc_tickadj">calc_tickadj</primary>
276 </indexterm>
277 </listitem>
278 </varlistentry>
279
[dc6715a]280 <varlistentry id="ntp-keygen">
281 <term><command>ntp-keygen</command></term>
282 <listitem>
[56ab82c]283 <para>generates cryptographic data files used by the NTPv4 authentication
[dc6715a]284 and identification schemes.</para>
285 <indexterm zone="ntp ntp-keygen">
286 <primary sortas="b-ntp-keygen">ntp-keygen</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
[56ab82c]290
[dc6715a]291 <varlistentry id="ntp-wait">
292 <term><command>ntp-wait</command></term>
293 <listitem>
[56ab82c]294 <para>is useful at boot time, to delay the boot sequence until
[dc6715a]295 <command>ntpd</command> has set the time.</para>
296 <indexterm zone="ntp ntp-wait">
297 <primary sortas="b-ntp-wait">ntp-wait</primary>
298 </indexterm>
299 </listitem>
300 </varlistentry>
[56ab82c]301
[dc6715a]302 <varlistentry id="ntpd">
303 <term><command>ntpd</command></term>
304 <listitem>
[286c613d]305 <para>is a ntp daemon that runs in the background and keeps
[56ab82c]306 the date and time synchronized based on response from configured
[286c613d]307 ntp servers. It also functions as a ntp server.</para>
[dc6715a]308 <indexterm zone="ntp ntpd">
309 <primary sortas="b-ntpd">ntpd</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
[56ab82c]313
[dc6715a]314 <varlistentry id="ntpdate">
315 <term><command>ntpdate</command></term>
316 <listitem>
[56ab82c]317 <para>is a client program that sets the date and time based on
[286c613d]318 the response from an ntp server. This command is deprecated.</para>
[dc6715a]319 <indexterm zone="ntp ntpdate">
320 <primary sortas="b-ntpdate">ntpdate</primary>
321 </indexterm>
322 </listitem>
323 </varlistentry>
[56ab82c]324
[dc6715a]325 <varlistentry id="ntpdc">
326 <term><command>ntpdc</command></term>
327 <listitem>
[286c613d]328 <para>is used to query the ntp daemon about its current state
[dc6715a]329 and to request changes in that state.</para>
330 <indexterm zone="ntp ntpdc">
331 <primary sortas="b-ntpdc">ntpdc</primary>
332 </indexterm>
333 </listitem>
334 </varlistentry>
[56ab82c]335
[dc6715a]336 <varlistentry id="ntpq">
337 <term><command>ntpq</command></term>
338 <listitem>
[56ab82c]339 <para>is an utility program used to monitor <command>ntpd</command>
[dc6715a]340 operations and determine performance.</para>
341 <indexterm zone="ntp ntpq">
342 <primary sortas="b-ntpq">ntpq</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
[56ab82c]346
[dc6715a]347 <varlistentry id="ntptime">
348 <term><command>ntptime</command></term>
349 <listitem>
350 <para>reads and displays time-related kernel variables.</para>
351 <indexterm zone="ntp ntptime">
352 <primary sortas="b-ntptime">ntptime</primary>
353 </indexterm>
354 </listitem>
355 </varlistentry>
[56ab82c]356
[dc6715a]357 <varlistentry id="ntptrace">
358 <term><command>ntptrace</command></term>
359 <listitem>
[286c613d]360 <para>traces a chain of ntp servers back to the primary source.</para>
[dc6715a]361 <indexterm zone="ntp ntptrace">
[56ab82c]362 <primary sortas="b-ntptrace">ntptrace</primary>
[dc6715a]363 </indexterm>
364 </listitem>
365 </varlistentry>
[56ab82c]366
[36474cb]367 <varlistentry id="sntp">
368 <term><command>sntp</command></term>
369 <listitem>
370 <para>is a Simple Network Time Protocol (SNTP) client.</para>
371 <indexterm zone="ntp sntp">
372 <primary sortas="b-sntp">sntp</primary>
373 </indexterm>
374 </listitem>
375 </varlistentry>
376
[dc6715a]377 <varlistentry id="tickadj">
378 <term><command>tickadj</command></term>
379 <listitem>
[56ab82c]380 <para>reads, and optionally modifies, several timekeeping-related
381 variables in older kernels that do not have support for precision
[dc6715a]382 timekeeping.</para>
383 <indexterm zone="ntp tickadj">
384 <primary sortas="b-tickadj">tickadj</primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
[56ab82c]388
[ab6a3f3]389 <varlistentry id="update-leap">
390 <term><command>update-leap</command></term>
391 <listitem>
392 <para>is a script to verify and, if necessary, update the leap-second
393 definition file.</para>
394 <indexterm zone="ntp update-leap">
395 <primary sortas="b-update-leap">update-leap</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
[dc6715a]400 </variablelist>
[56ab82c]401
[dc6715a]402 </sect2>
[56ab82c]403
[39f01ca]404</sect1>
Note: See TracBrowser for help on using the repository browser.