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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 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 8dfc5c3 was 8dfc5c3, checked in by Krejzi <krejzi@…>, 7 years ago

Fix some URLs

  • Switch to https:// scheme where possible to avoid redirects
  • Unify all kernel.org, Sourceforge and GNU URLs
  • Fix python and perl module URLs to be consistent
  • Fix github provided URLs to properly download tarballs instead of vFOO.tar.gz
  • Use upstream locations for some packages or better/shorter URLs if available
  • Add https:// URLs for gnupg packages

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

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