update-leap.html revision 338531
1<html lang="en">
2<head>
3<title>update-leap User's Manual</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="update-leap User's Manual">
6<meta name="generator" content="makeinfo 4.7">
7<link title="Top" rel="top" href="#Top">
8<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9<meta http-equiv="Content-Style-Type" content="text/css">
10<style type="text/css"><!--
11  pre.display { font-family:inherit }
12  pre.format  { font-family:inherit }
13  pre.smalldisplay { font-family:inherit; font-size:smaller }
14  pre.smallformat  { font-family:inherit; font-size:smaller }
15  pre.smallexample { font-size:smaller }
16  pre.smalllisp    { font-size:smaller }
17  span.sc { font-variant:small-caps }
18  span.roman { font-family: serif; font-weight: normal; } 
19--></style>
20</head>
21<body>
22<h1 class="settitle">update-leap User's Manual</h1>
23<div class="node">
24<p><hr>
25<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Description">update-leap Description</a>,
26Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
27Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
28<br>
29</div>
30
31  <p>This document describes the use of the NTP Project's <code>update-leap</code> program.
32
33  <p>This document applies to version 4.2.8p12 of <code>update-leap</code>.
34
35<div class="shortcontents">
36<h2>Short Contents</h2>
37<ul>
38</ul>
39</div>
40
41<ul class="menu">
42<li><a accesskey="1" href="#update_002dleap-Description">update-leap Description</a>:             Description
43<li><a accesskey="2" href="#update_002dleap-Invocation">update-leap Invocation</a>: 		Invoking update-leap
44</ul>
45
46<div class="node">
47<p><hr>
48<a name="update_002dleap-Invocation"></a>
49<br>
50</div>
51
52<h3 class="section">0.1 Invoking update-leap</h3>
53
54<p><a name="index-update_002dleap-1"></a><a name="index-leap_002dseconds-file-manager_002fupdater-2"></a>
55
56  <p><code>update-leap</code>
57will validate the file currently on the local system
58and if necessary, updates leap-second definition file.
59
60  <p>Ordinarily, the file is found using the "leapfile" directive in
61<code>ntp.conf(5)</code>. 
62However, an alternate location can be specified on the command line.
63
64  <p>If the file does not exist, is not valid, has expired, or is expiring soon,
65a new copy will be downloaded.  If the new copy validates, it is installed and
66NTP is (optionally) restarted.
67
68  <p>If the current file is acceptable, no download or restart occurs.
69
70  <p>-c can also be used to invoke another script to perform administrative
71functions, e.g. to copy the file to other local systems. 
72.PP
73This can be run as a cron job.  As the file is rarely updated, and leap
74seconds are announced at least one month in advance (usually longer), it
75need not be run more frequently than about once every three weeks. 
76.PP
77For cron-friendly behavior, define CRONJOB=1 in the crontab. 
78.PP
79This script depends on$REQUIREDCMDS
80
81  <p>This section was generated by <strong>AutoGen</strong>,
82using the <code>agtexi-cmd</code> template and the option descriptions for the <code>update-leap</code> program.
83
84<ul class="menu">
85<li><a accesskey="1" href="#update_002dleap-usage">update-leap usage</a>:                   update-leap help/usage (<span class="option">--help</span>)
86<li><a accesskey="2" href="#update_002dleap-source_002durl">update-leap source-url</a>:              source-url option (-s)
87<li><a accesskey="3" href="#update_002dleap-ipv4">update-leap ipv4</a>:                    ipv4 option (-4)
88<li><a accesskey="4" href="#update_002dleap-destination">update-leap destination</a>:             destination option (-d)
89<li><a accesskey="5" href="#update_002dleap-expiration">update-leap expiration</a>:              expiration option (-e)
90<li><a accesskey="6" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>:           ntp-conf-file option (-f)
91<li><a accesskey="7" href="#update_002dleap-force_002dupdate">update-leap force-update</a>:            force-update option (-F)
92<li><a accesskey="8" href="#update_002dleap-exit-status">update-leap exit status</a>:             exit status
93<li><a accesskey="9" href="#update_002dleap-Usage">update-leap Usage</a>:                   Usage
94<li><a href="#update_002dleap-Authors">update-leap Authors</a>:                 Authors
95</ul>
96
97<div class="node">
98<p><hr>
99<a name="update_002dleap-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-source_002durl">update-leap source-url</a>,
100Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
101<br>
102</div>
103
104<h4 class="subsection">0.1.1 update-leap help/usage (<span class="option">--help</span>)</h4>
105
106<p><a name="index-update_002dleap-help-3"></a>
107This is the automatically generated usage text for update-leap.
108
109  <p>The text printed is the same whether selected with the <code>help</code> option
110(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
111the usage text by passing it through a pager program. 
112<code>more-help</code> is disabled on platforms without a working
113<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
114used to select the program, defaulting to <span class="file">more</span>.  Both will exit
115with a status code of 0.
116
117<pre class="example">
118Usage: update-leap [options]
119
120Verifies and if necessary, updates leap-second definition file
121
122All arguments are optional:  Default (or current value) shown:
123    -C    Absolute path to CA Cert (see SSL/TLS Considerations)
124    -D    Path to a CAdir (see SSL/TLS Considerations)
125    -e    Specify how long (in days) before expiration the file is to be
126              refreshed.  Note that larger values imply more frequent refreshes.
127          60
128    -F    Force update even if current file is OK and not close to expiring.
129    -f    Absolute path ntp.conf file (default /etc/ntp.conf)
130          /etc/ntp.conf
131    -h    show help
132    -i    Specify number of minutes between retries
133          10
134    -L    Absolute path to leapfile on the local system
135          (overrides value in ntp.conf)
136    -l    Specify the syslog(3) facility for logging
137          LOG_USER
138    -q    Only report errors (cannot be used with -v)
139    -r    Specify number of attempts to retrieve file
140          6
141    -s    Send output to syslog(3) - implied if STDOUT has no tty or redirected
142    -t    Send output to terminal - implied if STDOUT attached to terminal
143    -u    Specify the URL of the master copy to download
144          https://www.ietf.org/timezones/data/leap-seconds.list
145    -v    Verbose - show debug messages (cannot be used with -q)
146
147The following options are not (yet) implemented in the perl version:
148    -4    Use only IPv4
149    -6    Use only IPv6
150    -c    Command to restart NTP after installing a new file
151          &lt;none&gt; - ntpd checks file daily
152    -p 4|6
153          Prefer IPv4 or IPv6 (as specified) addresses, but use either
154
155update-leap will validate the file currently on the local system.
156
157Ordinarily, the leapfile is found using the 'leapfile' directive in
158/etc/ntp.conf.  However, an alternate location can be specified on the
159command line with the -L flag.
160
161If the leapfile does not exist, is not valid, has expired, or is
162expiring soon, a new copy will be downloaded.  If the new copy is
163valid, it is installed.
164
165If the current file is acceptable, no download or restart occurs.
166
167This can be run as a cron job.  As the file is rarely updated, and
168leap seconds are announced at least one month in advance (usually
169longer), it need not be run more frequently than about once every
170three weeks.
171
172SSL/TLS Considerations
173-----------------------
174The perl modules can usually locate the CA certificate used to verify
175the peer's identity.
176
177On BSDs, the default is typically the file /etc/ssl/certs.pem.  On
178Linux, the location is typically a path to a CAdir - a directory of
179symlinks named according to a hash of the certificates' subject names.
180
181The -C or -D options are available to pass in a location if no CA cert
182is found in the default location.
183
184External Dependencies
185---------------------
186The following perl modules are required:
187HTTP::Tiny         - version &gt;= 0.056
188IO::Socket::SSL - version &gt;= 1.56
189NET::SSLeay         - version &gt;= 1.49
190
191Version: 1.004
192</pre>
193  <div class="node">
194<p><hr>
195<a name="update_002dleap-source_002durl"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-ipv4">update-leap ipv4</a>,
196Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-usage">update-leap usage</a>,
197Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
198<br>
199</div>
200
201<h4 class="subsection">0.1.2 source-url option (-s)</h4>
202
203<p><a name="index-update_002dleap_002dsource_002durl-4"></a>
204This is the &ldquo;the url of the master copy of the leapseconds file&rdquo; option. 
205This option takes a string argument. 
206Specify the URL of the master copy to download
207$LEAPSRC
208<div class="node">
209<p><hr>
210<a name="update_002dleap-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-destination">update-leap destination</a>,
211Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-source_002durl">update-leap source-url</a>,
212Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
213<br>
214</div>
215
216<h4 class="subsection">0.1.3 ipv4 option (-4)</h4>
217
218<p><a name="index-update_002dleap_002dipv4-5"></a>
219This is the &ldquo;use only ipv4 addresses for dns name resolution&rdquo; option.
220
221<p class="noindent">This option has some usage constraints.  It:
222     <ul>
223<li>must not appear in combination with any of the following options:
224ipv6. 
225</ul>
226
227  <p>Force DNS resolution of following host names on the command line
228        to the IPv4 namespace. 
229        _EndOfDoc_;
230;
231
232  <p>flag = 
233    name      = ipv6;
234    flags-cant = ipv4, prefer;
235    value     = 6;
236    descrip   = "Use only IPv6 addresses for DNS name resolution";
237    doc = &lt;&lt;-  _EndOfDoc_
238        Force DNS resolution of following host names on the command line
239        to the IPv6 namespace. 
240        _EndOfDoc_;
241;
242
243  <p>flag = 
244    name        = prefer;
245    flags-cant	= ipv4, ipv6;
246    value	= p;
247    arg-type    = keyword;
248    keyword	= 4, 6;
249    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
250    doc         = &lt;&lt;-  _EndOfDoc_
251Prefer IPv4 or IPv6 (as specified) addresses, but use either. 
252<div class="node">
253<p><hr>
254<a name="update_002dleap-destination"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-expiration">update-leap expiration</a>,
255Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ipv4">update-leap ipv4</a>,
256Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
257<br>
258</div>
259
260<h4 class="subsection">0.1.4 destination option (-d)</h4>
261
262<p><a name="index-update_002dleap_002ddestination-6"></a>
263This is the &ldquo;filename on the local system&rdquo; option. 
264This option takes a string argument <span class="file">float</span>. 
265The name to use to store the leapfile on the local system. 
266$LEAPFILE
267<div class="node">
268<p><hr>
269<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>,
270Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-destination">update-leap destination</a>,
271Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
272<br>
273</div>
274
275<h4 class="subsection">0.1.5 expiration option (-e)</h4>
276
277<p><a name="index-update_002dleap_002dexpiration-7"></a>
278This is the &ldquo;refresh the leapfile this long before it expires&rdquo; option. 
279This option takes a string argument. 
280Specify how long before expiration the file is to be refreshed
281Units are required, e.g. "-e 60 days"  Note that larger values
282imply more frequent refreshes. 
283"$PREFETCH"
284<div class="node">
285<p><hr>
286<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>,
287Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-expiration">update-leap expiration</a>,
288Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
289<br>
290</div>
291
292<h4 class="subsection">0.1.6 ntp-conf-file option (-f)</h4>
293
294<p><a name="index-update_002dleap_002dntp_002dconf_002dfile-8"></a>
295This is the &ldquo;location of the ntp.conf file&rdquo; option. 
296This option takes a string argument. 
297Specify location of ntp.conf (used to make sure leapfile directive is
298present and to default  leapfile)
299/etc/ntp.conf
300<div class="node">
301<p><hr>
302<a name="update_002dleap-force_002dupdate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-exit-status">update-leap exit status</a>,
303Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
304Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
305<br>
306</div>
307
308<h4 class="subsection">0.1.7 force-update option (-F)</h4>
309
310<p><a name="index-update_002dleap_002dforce_002dupdate-9"></a>
311This is the &ldquo;force update of the leapfile&rdquo; option. 
312Force update even if current file is OK and not close to expiring. 
313<div class="node">
314<p><hr>
315<a name="update_002dleap-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Usage">update-leap Usage</a>,
316Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
317Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
318<br>
319</div>
320
321<h4 class="subsection">0.1.8 update-leap exit status</h4>
322
323<p>One of the following exit values will be returned:
324     <dl>
325<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 
326<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 
327</dl>
328  <div class="node">
329<p><hr>
330<a name="update_002dleap-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Authors">update-leap Authors</a>,
331Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-exit-status">update-leap exit status</a>,
332Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
333<br>
334</div>
335
336<h4 class="subsection">0.1.9 update-leap Usage</h4>
337
338<div class="node">
339<p><hr>
340<a name="update_002dleap-Authors"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-Usage">update-leap Usage</a>,
341Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
342<br>
343</div>
344
345<h4 class="subsection">0.1.10 update-leap Authors</h4>
346
347</body></html>
348
349