xref: /freebsd/contrib/ntp/scripts/update-leap/update-leap.html (revision 091002585974d17c9533f943ec351c13a69788ab)
1a25439b6SCy Schubert<html lang="en">
2a25439b6SCy Schubert<head>
3a25439b6SCy Schubert<title>update-leap User's Manual</title>
4a25439b6SCy Schubert<meta http-equiv="Content-Type" content="text/html">
5a25439b6SCy Schubert<meta name="description" content="update-leap User's Manual">
6a25439b6SCy Schubert<meta name="generator" content="makeinfo 4.7">
7a25439b6SCy Schubert<link title="Top" rel="top" href="#Top">
8a25439b6SCy Schubert<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9a25439b6SCy Schubert<meta http-equiv="Content-Style-Type" content="text/css">
10a25439b6SCy Schubert<style type="text/css"><!--
11a25439b6SCy Schubert  pre.display { font-family:inherit }
12a25439b6SCy Schubert  pre.format  { font-family:inherit }
13a25439b6SCy Schubert  pre.smalldisplay { font-family:inherit; font-size:smaller }
14a25439b6SCy Schubert  pre.smallformat  { font-family:inherit; font-size:smaller }
15a25439b6SCy Schubert  pre.smallexample { font-size:smaller }
16a25439b6SCy Schubert  pre.smalllisp    { font-size:smaller }
17a25439b6SCy Schubert  span.sc { font-variant:small-caps }
18a25439b6SCy Schubert  span.roman { font-family: serif; font-weight: normal; }
19a25439b6SCy Schubert--></style>
20a25439b6SCy Schubert</head>
21a25439b6SCy Schubert<body>
22a25439b6SCy Schubert<h1 class="settitle">update-leap User's Manual</h1>
23a25439b6SCy Schubert<div class="node">
24a25439b6SCy Schubert<p><hr>
25a25439b6SCy Schubert<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Description">update-leap Description</a>,
26a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
27a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
28a25439b6SCy Schubert<br>
29a25439b6SCy Schubert</div>
30a25439b6SCy Schubert
31a25439b6SCy Schubert  <p>This document describes the use of the NTP Project's <code>update-leap</code> program.
32a25439b6SCy Schubert
33*09100258SXin LI  <p>This document applies to version 4.2.8p11 of <code>update-leap</code>.
34a25439b6SCy Schubert
35a25439b6SCy Schubert<div class="shortcontents">
36a25439b6SCy Schubert<h2>Short Contents</h2>
37a25439b6SCy Schubert<ul>
38a25439b6SCy Schubert</ul>
39a25439b6SCy Schubert</div>
40a25439b6SCy Schubert
41a25439b6SCy Schubert<ul class="menu">
42a25439b6SCy Schubert<li><a accesskey="1" href="#update_002dleap-Description">update-leap Description</a>:             Description
43a25439b6SCy Schubert<li><a accesskey="2" href="#update_002dleap-Invocation">update-leap Invocation</a>: 		Invoking update-leap
44a25439b6SCy Schubert</ul>
45a25439b6SCy Schubert
46a25439b6SCy Schubert<div class="node">
47a25439b6SCy Schubert<p><hr>
48a25439b6SCy Schubert<a name="update_002dleap-Invocation"></a>
49a25439b6SCy Schubert<br>
50a25439b6SCy Schubert</div>
51a25439b6SCy Schubert
52a25439b6SCy Schubert<h3 class="section">0.1 Invoking update-leap</h3>
53a25439b6SCy Schubert
54a25439b6SCy Schubert<p><a name="index-update_002dleap-1"></a><a name="index-leap_002dseconds-file-manager_002fupdater-2"></a>
55a25439b6SCy Schubert
56a25439b6SCy Schubert  <p><code>update-leap</code>
57a25439b6SCy Schubertwill validate the file currently on the local system
58a25439b6SCy Schubertand if necessary, updates leap-second definition file.
59a25439b6SCy Schubert
60a25439b6SCy Schubert  <p>Ordinarily, the file is found using the "leapfile" directive in
61a25439b6SCy Schubert<code>ntp.conf(5)</code>.
62a25439b6SCy SchubertHowever, an alternate location can be specified on the command line.
63a25439b6SCy Schubert
64a25439b6SCy Schubert  <p>If the file does not exist, is not valid, has expired, or is expiring soon,
65a25439b6SCy Schuberta new copy will be downloaded.  If the new copy validates, it is installed and
66a25439b6SCy SchubertNTP is (optionally) restarted.
67a25439b6SCy Schubert
68a25439b6SCy Schubert  <p>If the current file is acceptable, no download or restart occurs.
69a25439b6SCy Schubert
70a25439b6SCy Schubert  <p>-c can also be used to invoke another script to perform administrative
71a25439b6SCy Schubertfunctions, e.g. to copy the file to other local systems.
72a25439b6SCy Schubert.PP
73a25439b6SCy SchubertThis can be run as a cron job.  As the file is rarely updated, and leap
74a25439b6SCy Schubertseconds are announced at least one month in advance (usually longer), it
75a25439b6SCy Schubertneed not be run more frequently than about once every three weeks.
76a25439b6SCy Schubert.PP
77a25439b6SCy SchubertFor cron-friendly behavior, define CRONJOB=1 in the crontab.
78a25439b6SCy Schubert.PP
79a25439b6SCy SchubertThis script depends on$REQUIREDCMDS
80a25439b6SCy Schubert
81a25439b6SCy Schubert  <p>This section was generated by <strong>AutoGen</strong>,
82a25439b6SCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>update-leap</code> program.
83a25439b6SCy Schubert
84a25439b6SCy Schubert<ul class="menu">
85a25439b6SCy Schubert<li><a accesskey="1" href="#update_002dleap-usage">update-leap usage</a>:                   update-leap help/usage (<span class="option">--help</span>)
86a25439b6SCy Schubert<li><a accesskey="2" href="#update_002dleap-source_002durl">update-leap source-url</a>:              source-url option (-s)
87a25439b6SCy Schubert<li><a accesskey="3" href="#update_002dleap-ipv4">update-leap ipv4</a>:                    ipv4 option (-4)
88a25439b6SCy Schubert<li><a accesskey="4" href="#update_002dleap-destination">update-leap destination</a>:             destination option (-d)
89a25439b6SCy Schubert<li><a accesskey="5" href="#update_002dleap-expiration">update-leap expiration</a>:              expiration option (-e)
90a25439b6SCy Schubert<li><a accesskey="6" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>:           ntp-conf-file option (-f)
91a25439b6SCy Schubert<li><a accesskey="7" href="#update_002dleap-force_002dupdate">update-leap force-update</a>:            force-update option (-F)
92a25439b6SCy Schubert<li><a accesskey="8" href="#update_002dleap-exit-status">update-leap exit status</a>:             exit status
93a25439b6SCy Schubert<li><a accesskey="9" href="#update_002dleap-Usage">update-leap Usage</a>:                   Usage
94a25439b6SCy Schubert<li><a href="#update_002dleap-Authors">update-leap Authors</a>:                 Authors
95a25439b6SCy Schubert</ul>
96a25439b6SCy Schubert
97a25439b6SCy Schubert<div class="node">
98a25439b6SCy Schubert<p><hr>
99a25439b6SCy Schubert<a name="update_002dleap-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-source_002durl">update-leap source-url</a>,
100a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
101a25439b6SCy Schubert<br>
102a25439b6SCy Schubert</div>
103a25439b6SCy Schubert
104a25439b6SCy Schubert<h4 class="subsection">0.1.1 update-leap help/usage (<span class="option">--help</span>)</h4>
105a25439b6SCy Schubert
106a25439b6SCy Schubert<p><a name="index-update_002dleap-help-3"></a>
107a25439b6SCy SchubertThis is the automatically generated usage text for update-leap.
108a25439b6SCy Schubert
109a25439b6SCy Schubert  <p>The text printed is the same whether selected with the <code>help</code> option
110a25439b6SCy Schubert(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
111a25439b6SCy Schubertthe usage text by passing it through a pager program.
112a25439b6SCy Schubert<code>more-help</code> is disabled on platforms without a working
113a25439b6SCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
114a25439b6SCy Schubertused to select the program, defaulting to <span class="file">more</span>.  Both will exit
115a25439b6SCy Schubertwith a status code of 0.
116a25439b6SCy Schubert
117*09100258SXin LI<pre class="example">
118a25439b6SCy Schubert</pre>
119a25439b6SCy Schubert  <div class="node">
120a25439b6SCy Schubert<p><hr>
121a25439b6SCy Schubert<a name="update_002dleap-source_002durl"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-ipv4">update-leap ipv4</a>,
122a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-usage">update-leap usage</a>,
123a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
124a25439b6SCy Schubert<br>
125a25439b6SCy Schubert</div>
126a25439b6SCy Schubert
127a25439b6SCy Schubert<h4 class="subsection">0.1.2 source-url option (-s)</h4>
128a25439b6SCy Schubert
129a25439b6SCy Schubert<p><a name="index-update_002dleap_002dsource_002durl-4"></a>
130a25439b6SCy SchubertThis is the &ldquo;the url of the master copy of the leapseconds file&rdquo; option.
131a25439b6SCy SchubertThis option takes a string argument.
132a25439b6SCy SchubertSpecify the URL of the master copy to download
133a25439b6SCy Schubert$LEAPSRC
134a25439b6SCy Schubert<div class="node">
135a25439b6SCy Schubert<p><hr>
136a25439b6SCy Schubert<a name="update_002dleap-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-destination">update-leap destination</a>,
137a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-source_002durl">update-leap source-url</a>,
138a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
139a25439b6SCy Schubert<br>
140a25439b6SCy Schubert</div>
141a25439b6SCy Schubert
142a25439b6SCy Schubert<h4 class="subsection">0.1.3 ipv4 option (-4)</h4>
143a25439b6SCy Schubert
144a25439b6SCy Schubert<p><a name="index-update_002dleap_002dipv4-5"></a>
145a25439b6SCy SchubertThis is the &ldquo;use only ipv4 addresses for dns name resolution&rdquo; option.
146a25439b6SCy Schubert
147a25439b6SCy Schubert<p class="noindent">This option has some usage constraints.  It:
148a25439b6SCy Schubert     <ul>
149a25439b6SCy Schubert<li>must not appear in combination with any of the following options:
150a25439b6SCy Schubertipv6.
151a25439b6SCy Schubert</ul>
152a25439b6SCy Schubert
153a25439b6SCy Schubert  <p>Force DNS resolution of following host names on the command line
154a25439b6SCy Schubert        to the IPv4 namespace.
155a25439b6SCy Schubert        _EndOfDoc_;
156a25439b6SCy Schubert;
157a25439b6SCy Schubert
158a25439b6SCy Schubert  <p>flag =
159a25439b6SCy Schubert    name      = ipv6;
160a25439b6SCy Schubert    flags-cant = ipv4, prefer;
161a25439b6SCy Schubert    value     = 6;
162a25439b6SCy Schubert    descrip   = "Use only IPv6 addresses for DNS name resolution";
163a25439b6SCy Schubert    doc = &lt;&lt;-  _EndOfDoc_
164a25439b6SCy Schubert        Force DNS resolution of following host names on the command line
165a25439b6SCy Schubert        to the IPv6 namespace.
166a25439b6SCy Schubert        _EndOfDoc_;
167a25439b6SCy Schubert;
168a25439b6SCy Schubert
169a25439b6SCy Schubert  <p>flag =
170a25439b6SCy Schubert    name        = prefer;
171a25439b6SCy Schubert    flags-cant	= ipv4, ipv6;
172a25439b6SCy Schubert    value	= p;
173a25439b6SCy Schubert    arg-type    = keyword;
174a25439b6SCy Schubert    keyword	= 4, 6;
175a25439b6SCy Schubert    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
176a25439b6SCy Schubert    doc         = &lt;&lt;-  _EndOfDoc_
177a25439b6SCy SchubertPrefer IPv4 or IPv6 (as specified) addresses, but use either.
178a25439b6SCy Schubert<div class="node">
179a25439b6SCy Schubert<p><hr>
180a25439b6SCy Schubert<a name="update_002dleap-destination"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-expiration">update-leap expiration</a>,
181a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ipv4">update-leap ipv4</a>,
182a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
183a25439b6SCy Schubert<br>
184a25439b6SCy Schubert</div>
185a25439b6SCy Schubert
186a25439b6SCy Schubert<h4 class="subsection">0.1.4 destination option (-d)</h4>
187a25439b6SCy Schubert
188a25439b6SCy Schubert<p><a name="index-update_002dleap_002ddestination-6"></a>
189a25439b6SCy SchubertThis is the &ldquo;filename on the local system&rdquo; option.
190a25439b6SCy SchubertThis option takes a string argument <span class="file">float</span>.
191a25439b6SCy SchubertThe name to use to store the leapfile on the local system.
192a25439b6SCy Schubert$LEAPFILE
193a25439b6SCy Schubert<div class="node">
194a25439b6SCy Schubert<p><hr>
195a25439b6SCy Schubert<a name="update_002dleap-expiration"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
196a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-destination">update-leap destination</a>,
197a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
198a25439b6SCy Schubert<br>
199a25439b6SCy Schubert</div>
200a25439b6SCy Schubert
201a25439b6SCy Schubert<h4 class="subsection">0.1.5 expiration option (-e)</h4>
202a25439b6SCy Schubert
203a25439b6SCy Schubert<p><a name="index-update_002dleap_002dexpiration-7"></a>
204a25439b6SCy SchubertThis is the &ldquo;refresh the leapfile this long before it expires&rdquo; option.
205a25439b6SCy SchubertThis option takes a string argument.
206a25439b6SCy SchubertSpecify how long before expiration the file is to be refreshed
207a25439b6SCy SchubertUnits are required, e.g. "-e 60 days"  Note that larger values
208a25439b6SCy Schubertimply more frequent refreshes.
209a25439b6SCy Schubert"$PREFETCH"
210a25439b6SCy Schubert<div class="node">
211a25439b6SCy Schubert<p><hr>
212a25439b6SCy Schubert<a name="update_002dleap-ntp_002dconf_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
213a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-expiration">update-leap expiration</a>,
214a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
215a25439b6SCy Schubert<br>
216a25439b6SCy Schubert</div>
217a25439b6SCy Schubert
218a25439b6SCy Schubert<h4 class="subsection">0.1.6 ntp-conf-file option (-f)</h4>
219a25439b6SCy Schubert
220a25439b6SCy Schubert<p><a name="index-update_002dleap_002dntp_002dconf_002dfile-8"></a>
221a25439b6SCy SchubertThis is the &ldquo;location of the ntp.conf file&rdquo; option.
222a25439b6SCy SchubertThis option takes a string argument.
223a25439b6SCy SchubertSpecify location of ntp.conf (used to make sure leapfile directive is
224a25439b6SCy Schubertpresent and to default  leapfile)
225a25439b6SCy Schubert/etc/ntp.conf
226a25439b6SCy Schubert<div class="node">
227a25439b6SCy Schubert<p><hr>
228a25439b6SCy Schubert<a name="update_002dleap-force_002dupdate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-exit-status">update-leap exit status</a>,
229a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
230a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
231a25439b6SCy Schubert<br>
232a25439b6SCy Schubert</div>
233a25439b6SCy Schubert
234a25439b6SCy Schubert<h4 class="subsection">0.1.7 force-update option (-F)</h4>
235a25439b6SCy Schubert
236a25439b6SCy Schubert<p><a name="index-update_002dleap_002dforce_002dupdate-9"></a>
237a25439b6SCy SchubertThis is the &ldquo;force update of the leapfile&rdquo; option.
238a25439b6SCy SchubertForce update even if current file is OK and not close to expiring.
239a25439b6SCy Schubert<div class="node">
240a25439b6SCy Schubert<p><hr>
241a25439b6SCy Schubert<a name="update_002dleap-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Usage">update-leap Usage</a>,
242a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
243a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
244a25439b6SCy Schubert<br>
245a25439b6SCy Schubert</div>
246a25439b6SCy Schubert
247a25439b6SCy Schubert<h4 class="subsection">0.1.8 update-leap exit status</h4>
248a25439b6SCy Schubert
249a25439b6SCy Schubert<p>One of the following exit values will be returned:
250a25439b6SCy Schubert     <dl>
251a25439b6SCy Schubert<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
252a25439b6SCy Schubert<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
253a25439b6SCy Schubert</dl>
254a25439b6SCy Schubert  <div class="node">
255a25439b6SCy Schubert<p><hr>
256a25439b6SCy Schubert<a name="update_002dleap-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Authors">update-leap Authors</a>,
257a25439b6SCy SchubertPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-exit-status">update-leap exit status</a>,
258a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
259a25439b6SCy Schubert<br>
260a25439b6SCy Schubert</div>
261a25439b6SCy Schubert
262a25439b6SCy Schubert<h4 class="subsection">0.1.9 update-leap Usage</h4>
263a25439b6SCy Schubert
264a25439b6SCy Schubert<div class="node">
265a25439b6SCy Schubert<p><hr>
266a25439b6SCy Schubert<a name="update_002dleap-Authors"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-Usage">update-leap Usage</a>,
267a25439b6SCy SchubertUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
268a25439b6SCy Schubert<br>
269a25439b6SCy Schubert</div>
270a25439b6SCy Schubert
271a25439b6SCy Schubert<h4 class="subsection">0.1.10 update-leap Authors</h4>
272a25439b6SCy Schubert
273a25439b6SCy Schubert</body></html>
274a25439b6SCy Schubert
275