1281348Scy<html lang="en">
2281348Scy<head>
3281348Scy<title>update-leap User's Manual</title>
4281348Scy<meta http-equiv="Content-Type" content="text/html">
5281348Scy<meta name="description" content="update-leap User's Manual">
6281348Scy<meta name="generator" content="makeinfo 4.7">
7281348Scy<link title="Top" rel="top" href="#Top">
8281348Scy<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9281348Scy<meta http-equiv="Content-Style-Type" content="text/css">
10281348Scy<style type="text/css"><!--
11281348Scy  pre.display { font-family:inherit }
12281348Scy  pre.format  { font-family:inherit }
13281348Scy  pre.smalldisplay { font-family:inherit; font-size:smaller }
14281348Scy  pre.smallformat  { font-family:inherit; font-size:smaller }
15281348Scy  pre.smallexample { font-size:smaller }
16281348Scy  pre.smalllisp    { font-size:smaller }
17281348Scy  span.sc { font-variant:small-caps }
18281348Scy  span.roman { font-family: serif; font-weight: normal; } 
19281348Scy--></style>
20281348Scy</head>
21281348Scy<body>
22281348Scy<h1 class="settitle">update-leap User's Manual</h1>
23281348Scy<div class="node">
24281348Scy<p><hr>
25281348Scy<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Description">update-leap Description</a>,
26281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
27281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
28281348Scy<br>
29281348Scy</div>
30281348Scy
31281348Scy  <p>This document describes the use of the NTP Project's <code>update-leap</code> program.
32281348Scy
33338531Sdelphij  <p>This document applies to version 4.2.8p12 of <code>update-leap</code>.
34281348Scy
35281348Scy<div class="shortcontents">
36281348Scy<h2>Short Contents</h2>
37281348Scy<ul>
38281348Scy</ul>
39281348Scy</div>
40281348Scy
41281348Scy<ul class="menu">
42281348Scy<li><a accesskey="1" href="#update_002dleap-Description">update-leap Description</a>:             Description
43281348Scy<li><a accesskey="2" href="#update_002dleap-Invocation">update-leap Invocation</a>: 		Invoking update-leap
44281348Scy</ul>
45281348Scy
46281348Scy<div class="node">
47281348Scy<p><hr>
48281348Scy<a name="update_002dleap-Invocation"></a>
49281348Scy<br>
50281348Scy</div>
51281348Scy
52281348Scy<h3 class="section">0.1 Invoking update-leap</h3>
53281348Scy
54281348Scy<p><a name="index-update_002dleap-1"></a><a name="index-leap_002dseconds-file-manager_002fupdater-2"></a>
55281348Scy
56281348Scy  <p><code>update-leap</code>
57281348Scywill validate the file currently on the local system
58281348Scyand if necessary, updates leap-second definition file.
59281348Scy
60281348Scy  <p>Ordinarily, the file is found using the "leapfile" directive in
61281348Scy<code>ntp.conf(5)</code>. 
62281348ScyHowever, an alternate location can be specified on the command line.
63281348Scy
64281348Scy  <p>If the file does not exist, is not valid, has expired, or is expiring soon,
65281348Scya new copy will be downloaded.  If the new copy validates, it is installed and
66281348ScyNTP is (optionally) restarted.
67281348Scy
68281348Scy  <p>If the current file is acceptable, no download or restart occurs.
69281348Scy
70281348Scy  <p>-c can also be used to invoke another script to perform administrative
71281348Scyfunctions, e.g. to copy the file to other local systems. 
72281348Scy.PP
73281348ScyThis can be run as a cron job.  As the file is rarely updated, and leap
74281348Scyseconds are announced at least one month in advance (usually longer), it
75281348Scyneed not be run more frequently than about once every three weeks. 
76281348Scy.PP
77281348ScyFor cron-friendly behavior, define CRONJOB=1 in the crontab. 
78281348Scy.PP
79281348ScyThis script depends on$REQUIREDCMDS
80281348Scy
81281348Scy  <p>This section was generated by <strong>AutoGen</strong>,
82281348Scyusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>update-leap</code> program.
83281348Scy
84281348Scy<ul class="menu">
85281348Scy<li><a accesskey="1" href="#update_002dleap-usage">update-leap usage</a>:                   update-leap help/usage (<span class="option">--help</span>)
86281348Scy<li><a accesskey="2" href="#update_002dleap-source_002durl">update-leap source-url</a>:              source-url option (-s)
87281348Scy<li><a accesskey="3" href="#update_002dleap-ipv4">update-leap ipv4</a>:                    ipv4 option (-4)
88281348Scy<li><a accesskey="4" href="#update_002dleap-destination">update-leap destination</a>:             destination option (-d)
89281348Scy<li><a accesskey="5" href="#update_002dleap-expiration">update-leap expiration</a>:              expiration option (-e)
90281348Scy<li><a accesskey="6" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>:           ntp-conf-file option (-f)
91281348Scy<li><a accesskey="7" href="#update_002dleap-force_002dupdate">update-leap force-update</a>:            force-update option (-F)
92281348Scy<li><a accesskey="8" href="#update_002dleap-exit-status">update-leap exit status</a>:             exit status
93281348Scy<li><a accesskey="9" href="#update_002dleap-Usage">update-leap Usage</a>:                   Usage
94281348Scy<li><a href="#update_002dleap-Authors">update-leap Authors</a>:                 Authors
95281348Scy</ul>
96281348Scy
97281348Scy<div class="node">
98281348Scy<p><hr>
99281348Scy<a name="update_002dleap-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-source_002durl">update-leap source-url</a>,
100281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
101281348Scy<br>
102281348Scy</div>
103281348Scy
104281348Scy<h4 class="subsection">0.1.1 update-leap help/usage (<span class="option">--help</span>)</h4>
105281348Scy
106281348Scy<p><a name="index-update_002dleap-help-3"></a>
107281348ScyThis is the automatically generated usage text for update-leap.
108281348Scy
109281348Scy  <p>The text printed is the same whether selected with the <code>help</code> option
110281348Scy(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
111281348Scythe usage text by passing it through a pager program. 
112281348Scy<code>more-help</code> is disabled on platforms without a working
113281348Scy<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
114281348Scyused to select the program, defaulting to <span class="file">more</span>.  Both will exit
115281348Scywith a status code of 0.
116281348Scy
117330141Sdelphij<pre class="example">
118338531SdelphijUsage: update-leap [options]
119338531Sdelphij
120338531SdelphijVerifies and if necessary, updates leap-second definition file
121338531Sdelphij
122338531SdelphijAll arguments are optional:  Default (or current value) shown:
123338531Sdelphij    -C    Absolute path to CA Cert (see SSL/TLS Considerations)
124338531Sdelphij    -D    Path to a CAdir (see SSL/TLS Considerations)
125338531Sdelphij    -e    Specify how long (in days) before expiration the file is to be
126338531Sdelphij              refreshed.  Note that larger values imply more frequent refreshes.
127338531Sdelphij          60
128338531Sdelphij    -F    Force update even if current file is OK and not close to expiring.
129338531Sdelphij    -f    Absolute path ntp.conf file (default /etc/ntp.conf)
130338531Sdelphij          /etc/ntp.conf
131338531Sdelphij    -h    show help
132338531Sdelphij    -i    Specify number of minutes between retries
133338531Sdelphij          10
134338531Sdelphij    -L    Absolute path to leapfile on the local system
135338531Sdelphij          (overrides value in ntp.conf)
136338531Sdelphij    -l    Specify the syslog(3) facility for logging
137338531Sdelphij          LOG_USER
138338531Sdelphij    -q    Only report errors (cannot be used with -v)
139338531Sdelphij    -r    Specify number of attempts to retrieve file
140338531Sdelphij          6
141338531Sdelphij    -s    Send output to syslog(3) - implied if STDOUT has no tty or redirected
142338531Sdelphij    -t    Send output to terminal - implied if STDOUT attached to terminal
143338531Sdelphij    -u    Specify the URL of the master copy to download
144338531Sdelphij          https://www.ietf.org/timezones/data/leap-seconds.list
145338531Sdelphij    -v    Verbose - show debug messages (cannot be used with -q)
146338531Sdelphij
147338531SdelphijThe following options are not (yet) implemented in the perl version:
148338531Sdelphij    -4    Use only IPv4
149338531Sdelphij    -6    Use only IPv6
150338531Sdelphij    -c    Command to restart NTP after installing a new file
151338531Sdelphij          &lt;none&gt; - ntpd checks file daily
152338531Sdelphij    -p 4|6
153338531Sdelphij          Prefer IPv4 or IPv6 (as specified) addresses, but use either
154338531Sdelphij
155338531Sdelphijupdate-leap will validate the file currently on the local system.
156338531Sdelphij
157338531SdelphijOrdinarily, the leapfile is found using the 'leapfile' directive in
158338531Sdelphij/etc/ntp.conf.  However, an alternate location can be specified on the
159338531Sdelphijcommand line with the -L flag.
160338531Sdelphij
161338531SdelphijIf the leapfile does not exist, is not valid, has expired, or is
162338531Sdelphijexpiring soon, a new copy will be downloaded.  If the new copy is
163338531Sdelphijvalid, it is installed.
164338531Sdelphij
165338531SdelphijIf the current file is acceptable, no download or restart occurs.
166338531Sdelphij
167338531SdelphijThis can be run as a cron job.  As the file is rarely updated, and
168338531Sdelphijleap seconds are announced at least one month in advance (usually
169338531Sdelphijlonger), it need not be run more frequently than about once every
170338531Sdelphijthree weeks.
171338531Sdelphij
172338531SdelphijSSL/TLS Considerations
173338531Sdelphij-----------------------
174338531SdelphijThe perl modules can usually locate the CA certificate used to verify
175338531Sdelphijthe peer's identity.
176338531Sdelphij
177338531SdelphijOn BSDs, the default is typically the file /etc/ssl/certs.pem.  On
178338531SdelphijLinux, the location is typically a path to a CAdir - a directory of
179338531Sdelphijsymlinks named according to a hash of the certificates' subject names.
180338531Sdelphij
181338531SdelphijThe -C or -D options are available to pass in a location if no CA cert
182338531Sdelphijis found in the default location.
183338531Sdelphij
184338531SdelphijExternal Dependencies
185338531Sdelphij---------------------
186338531SdelphijThe following perl modules are required:
187338531SdelphijHTTP::Tiny         - version &gt;= 0.056
188338531SdelphijIO::Socket::SSL - version &gt;= 1.56
189338531SdelphijNET::SSLeay         - version &gt;= 1.49
190338531Sdelphij
191338531SdelphijVersion: 1.004
192281348Scy</pre>
193281348Scy  <div class="node">
194281348Scy<p><hr>
195281348Scy<a name="update_002dleap-source_002durl"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-ipv4">update-leap ipv4</a>,
196281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-usage">update-leap usage</a>,
197281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
198281348Scy<br>
199281348Scy</div>
200281348Scy
201281348Scy<h4 class="subsection">0.1.2 source-url option (-s)</h4>
202281348Scy
203281348Scy<p><a name="index-update_002dleap_002dsource_002durl-4"></a>
204281348ScyThis is the &ldquo;the url of the master copy of the leapseconds file&rdquo; option. 
205281348ScyThis option takes a string argument. 
206281348ScySpecify the URL of the master copy to download
207281348Scy$LEAPSRC
208281348Scy<div class="node">
209281348Scy<p><hr>
210281348Scy<a name="update_002dleap-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-destination">update-leap destination</a>,
211281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-source_002durl">update-leap source-url</a>,
212281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
213281348Scy<br>
214281348Scy</div>
215281348Scy
216281348Scy<h4 class="subsection">0.1.3 ipv4 option (-4)</h4>
217281348Scy
218281348Scy<p><a name="index-update_002dleap_002dipv4-5"></a>
219281348ScyThis is the &ldquo;use only ipv4 addresses for dns name resolution&rdquo; option.
220281348Scy
221281348Scy<p class="noindent">This option has some usage constraints.  It:
222281348Scy     <ul>
223281348Scy<li>must not appear in combination with any of the following options:
224281348Scyipv6. 
225281348Scy</ul>
226281348Scy
227281348Scy  <p>Force DNS resolution of following host names on the command line
228281348Scy        to the IPv4 namespace. 
229281348Scy        _EndOfDoc_;
230281348Scy;
231281348Scy
232281348Scy  <p>flag = 
233281348Scy    name      = ipv6;
234281348Scy    flags-cant = ipv4, prefer;
235281348Scy    value     = 6;
236281348Scy    descrip   = "Use only IPv6 addresses for DNS name resolution";
237281348Scy    doc = &lt;&lt;-  _EndOfDoc_
238281348Scy        Force DNS resolution of following host names on the command line
239281348Scy        to the IPv6 namespace. 
240281348Scy        _EndOfDoc_;
241281348Scy;
242281348Scy
243281348Scy  <p>flag = 
244281348Scy    name        = prefer;
245281348Scy    flags-cant	= ipv4, ipv6;
246281348Scy    value	= p;
247281348Scy    arg-type    = keyword;
248281348Scy    keyword	= 4, 6;
249281348Scy    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
250281348Scy    doc         = &lt;&lt;-  _EndOfDoc_
251281348ScyPrefer IPv4 or IPv6 (as specified) addresses, but use either. 
252281348Scy<div class="node">
253281348Scy<p><hr>
254281348Scy<a name="update_002dleap-destination"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-expiration">update-leap expiration</a>,
255281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ipv4">update-leap ipv4</a>,
256281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
257281348Scy<br>
258281348Scy</div>
259281348Scy
260281348Scy<h4 class="subsection">0.1.4 destination option (-d)</h4>
261281348Scy
262281348Scy<p><a name="index-update_002dleap_002ddestination-6"></a>
263281348ScyThis is the &ldquo;filename on the local system&rdquo; option. 
264281348ScyThis option takes a string argument <span class="file">float</span>. 
265281348ScyThe name to use to store the leapfile on the local system. 
266281348Scy$LEAPFILE
267281348Scy<div class="node">
268281348Scy<p><hr>
269281348Scy<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>,
270281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-destination">update-leap destination</a>,
271281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
272281348Scy<br>
273281348Scy</div>
274281348Scy
275281348Scy<h4 class="subsection">0.1.5 expiration option (-e)</h4>
276281348Scy
277281348Scy<p><a name="index-update_002dleap_002dexpiration-7"></a>
278281348ScyThis is the &ldquo;refresh the leapfile this long before it expires&rdquo; option. 
279281348ScyThis option takes a string argument. 
280281348ScySpecify how long before expiration the file is to be refreshed
281281348ScyUnits are required, e.g. "-e 60 days"  Note that larger values
282281348Scyimply more frequent refreshes. 
283281348Scy"$PREFETCH"
284281348Scy<div class="node">
285281348Scy<p><hr>
286281348Scy<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>,
287281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-expiration">update-leap expiration</a>,
288281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
289281348Scy<br>
290281348Scy</div>
291281348Scy
292281348Scy<h4 class="subsection">0.1.6 ntp-conf-file option (-f)</h4>
293281348Scy
294281348Scy<p><a name="index-update_002dleap_002dntp_002dconf_002dfile-8"></a>
295281348ScyThis is the &ldquo;location of the ntp.conf file&rdquo; option. 
296281348ScyThis option takes a string argument. 
297281348ScySpecify location of ntp.conf (used to make sure leapfile directive is
298281348Scypresent and to default  leapfile)
299281348Scy/etc/ntp.conf
300281348Scy<div class="node">
301281348Scy<p><hr>
302281348Scy<a name="update_002dleap-force_002dupdate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-exit-status">update-leap exit status</a>,
303281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
304281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
305281348Scy<br>
306281348Scy</div>
307281348Scy
308281348Scy<h4 class="subsection">0.1.7 force-update option (-F)</h4>
309281348Scy
310281348Scy<p><a name="index-update_002dleap_002dforce_002dupdate-9"></a>
311281348ScyThis is the &ldquo;force update of the leapfile&rdquo; option. 
312281348ScyForce update even if current file is OK and not close to expiring. 
313281348Scy<div class="node">
314281348Scy<p><hr>
315281348Scy<a name="update_002dleap-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Usage">update-leap Usage</a>,
316281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
317281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
318281348Scy<br>
319281348Scy</div>
320281348Scy
321281348Scy<h4 class="subsection">0.1.8 update-leap exit status</h4>
322281348Scy
323281348Scy<p>One of the following exit values will be returned:
324281348Scy     <dl>
325281348Scy<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 
326281348Scy<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 
327281348Scy</dl>
328281348Scy  <div class="node">
329281348Scy<p><hr>
330281348Scy<a name="update_002dleap-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Authors">update-leap Authors</a>,
331281348ScyPrevious:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-exit-status">update-leap exit status</a>,
332281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
333281348Scy<br>
334281348Scy</div>
335281348Scy
336281348Scy<h4 class="subsection">0.1.9 update-leap Usage</h4>
337281348Scy
338281348Scy<div class="node">
339281348Scy<p><hr>
340281348Scy<a name="update_002dleap-Authors"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-Usage">update-leap Usage</a>,
341281348ScyUp:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
342281348Scy<br>
343281348Scy</div>
344281348Scy
345281348Scy<h4 class="subsection">0.1.10 update-leap Authors</h4>
346281348Scy
347281348Scy</body></html>
348281348Scy
349