source: networking/netprogs/ntp.xml@ dfbed54

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 12.2 7.10 7.4 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 gimp3 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/for-12.3 xry111/intltool xry111/llvm18 xry111/soup3 xry111/spidermonkey128 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since dfbed54 was 9c8f48d3, checked in by Krejzi <krejzi@…>, 12 years ago

xinglp says that we need this for -u ntp:ntp to work.

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

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