349 lines
15 KiB
HTML
349 lines
15 KiB
HTML
<html lang="en">
|
|
<head>
|
|
<title>update-leap User's Manual</title>
|
|
<meta http-equiv="Content-Type" content="text/html">
|
|
<meta name="description" content="update-leap User's Manual">
|
|
<meta name="generator" content="makeinfo 4.7">
|
|
<link title="Top" rel="top" href="#Top">
|
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
<style type="text/css"><!--
|
|
pre.display { font-family:inherit }
|
|
pre.format { font-family:inherit }
|
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
|
pre.smallexample { font-size:smaller }
|
|
pre.smalllisp { font-size:smaller }
|
|
span.sc { font-variant:small-caps }
|
|
span.roman { font-family: serif; font-weight: normal; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
<h1 class="settitle">update-leap User's Manual</h1>
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="Top"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-Description">update-leap Description</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
|
|
Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
|
|
<br>
|
|
</div>
|
|
|
|
<p>This document describes the use of the NTP Project's <code>update-leap</code> program.
|
|
|
|
<p>This document applies to version 4.2.8p12 of <code>update-leap</code>.
|
|
|
|
<div class="shortcontents">
|
|
<h2>Short Contents</h2>
|
|
<ul>
|
|
</ul>
|
|
</div>
|
|
|
|
<ul class="menu">
|
|
<li><a accesskey="1" href="#update_002dleap-Description">update-leap Description</a>: Description
|
|
<li><a accesskey="2" href="#update_002dleap-Invocation">update-leap Invocation</a>: Invoking update-leap
|
|
</ul>
|
|
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-Invocation"></a>
|
|
<br>
|
|
</div>
|
|
|
|
<h3 class="section">0.1 Invoking update-leap</h3>
|
|
|
|
<p><a name="index-update_002dleap-1"></a><a name="index-leap_002dseconds-file-manager_002fupdater-2"></a>
|
|
|
|
<p><code>update-leap</code>
|
|
will validate the file currently on the local system
|
|
and if necessary, updates leap-second definition file.
|
|
|
|
<p>Ordinarily, the file is found using the "leapfile" directive in
|
|
<code>ntp.conf(5)</code>.
|
|
However, an alternate location can be specified on the command line.
|
|
|
|
<p>If the file does not exist, is not valid, has expired, or is expiring soon,
|
|
a new copy will be downloaded. If the new copy validates, it is installed and
|
|
NTP is (optionally) restarted.
|
|
|
|
<p>If the current file is acceptable, no download or restart occurs.
|
|
|
|
<p>-c can also be used to invoke another script to perform administrative
|
|
functions, e.g. to copy the file to other local systems.
|
|
.PP
|
|
This can be run as a cron job. As the file is rarely updated, and leap
|
|
seconds are announced at least one month in advance (usually longer), it
|
|
need not be run more frequently than about once every three weeks.
|
|
.PP
|
|
For cron-friendly behavior, define CRONJOB=1 in the crontab.
|
|
.PP
|
|
This script depends on$REQUIREDCMDS
|
|
|
|
<p>This section was generated by <strong>AutoGen</strong>,
|
|
using the <code>agtexi-cmd</code> template and the option descriptions for the <code>update-leap</code> program.
|
|
|
|
<ul class="menu">
|
|
<li><a accesskey="1" href="#update_002dleap-usage">update-leap usage</a>: update-leap help/usage (<span class="option">--help</span>)
|
|
<li><a accesskey="2" href="#update_002dleap-source_002durl">update-leap source-url</a>: source-url option (-s)
|
|
<li><a accesskey="3" href="#update_002dleap-ipv4">update-leap ipv4</a>: ipv4 option (-4)
|
|
<li><a accesskey="4" href="#update_002dleap-destination">update-leap destination</a>: destination option (-d)
|
|
<li><a accesskey="5" href="#update_002dleap-expiration">update-leap expiration</a>: expiration option (-e)
|
|
<li><a accesskey="6" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>: ntp-conf-file option (-f)
|
|
<li><a accesskey="7" href="#update_002dleap-force_002dupdate">update-leap force-update</a>: force-update option (-F)
|
|
<li><a accesskey="8" href="#update_002dleap-exit-status">update-leap exit status</a>: exit status
|
|
<li><a accesskey="9" href="#update_002dleap-Usage">update-leap Usage</a>: Usage
|
|
<li><a href="#update_002dleap-Authors">update-leap Authors</a>: Authors
|
|
</ul>
|
|
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-usage"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-source_002durl">update-leap source-url</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.1 update-leap help/usage (<span class="option">--help</span>)</h4>
|
|
|
|
<p><a name="index-update_002dleap-help-3"></a>
|
|
This is the automatically generated usage text for update-leap.
|
|
|
|
<p>The text printed is the same whether selected with the <code>help</code> option
|
|
(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
|
|
the usage text by passing it through a pager program.
|
|
<code>more-help</code> is disabled on platforms without a working
|
|
<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
|
|
used to select the program, defaulting to <span class="file">more</span>. Both will exit
|
|
with a status code of 0.
|
|
|
|
<pre class="example">
|
|
Usage: update-leap [options]
|
|
|
|
Verifies and if necessary, updates leap-second definition file
|
|
|
|
All arguments are optional: Default (or current value) shown:
|
|
-C Absolute path to CA Cert (see SSL/TLS Considerations)
|
|
-D Path to a CAdir (see SSL/TLS Considerations)
|
|
-e Specify how long (in days) before expiration the file is to be
|
|
refreshed. Note that larger values imply more frequent refreshes.
|
|
60
|
|
-F Force update even if current file is OK and not close to expiring.
|
|
-f Absolute path ntp.conf file (default /etc/ntp.conf)
|
|
/etc/ntp.conf
|
|
-h show help
|
|
-i Specify number of minutes between retries
|
|
10
|
|
-L Absolute path to leapfile on the local system
|
|
(overrides value in ntp.conf)
|
|
-l Specify the syslog(3) facility for logging
|
|
LOG_USER
|
|
-q Only report errors (cannot be used with -v)
|
|
-r Specify number of attempts to retrieve file
|
|
6
|
|
-s Send output to syslog(3) - implied if STDOUT has no tty or redirected
|
|
-t Send output to terminal - implied if STDOUT attached to terminal
|
|
-u Specify the URL of the master copy to download
|
|
https://www.ietf.org/timezones/data/leap-seconds.list
|
|
-v Verbose - show debug messages (cannot be used with -q)
|
|
|
|
The following options are not (yet) implemented in the perl version:
|
|
-4 Use only IPv4
|
|
-6 Use only IPv6
|
|
-c Command to restart NTP after installing a new file
|
|
<none> - ntpd checks file daily
|
|
-p 4|6
|
|
Prefer IPv4 or IPv6 (as specified) addresses, but use either
|
|
|
|
update-leap will validate the file currently on the local system.
|
|
|
|
Ordinarily, the leapfile is found using the 'leapfile' directive in
|
|
/etc/ntp.conf. However, an alternate location can be specified on the
|
|
command line with the -L flag.
|
|
|
|
If the leapfile does not exist, is not valid, has expired, or is
|
|
expiring soon, a new copy will be downloaded. If the new copy is
|
|
valid, it is installed.
|
|
|
|
If the current file is acceptable, no download or restart occurs.
|
|
|
|
This can be run as a cron job. As the file is rarely updated, and
|
|
leap seconds are announced at least one month in advance (usually
|
|
longer), it need not be run more frequently than about once every
|
|
three weeks.
|
|
|
|
SSL/TLS Considerations
|
|
-----------------------
|
|
The perl modules can usually locate the CA certificate used to verify
|
|
the peer's identity.
|
|
|
|
On BSDs, the default is typically the file /etc/ssl/certs.pem. On
|
|
Linux, the location is typically a path to a CAdir - a directory of
|
|
symlinks named according to a hash of the certificates' subject names.
|
|
|
|
The -C or -D options are available to pass in a location if no CA cert
|
|
is found in the default location.
|
|
|
|
External Dependencies
|
|
---------------------
|
|
The following perl modules are required:
|
|
HTTP::Tiny - version >= 0.056
|
|
IO::Socket::SSL - version >= 1.56
|
|
NET::SSLeay - version >= 1.49
|
|
|
|
Version: 1.004
|
|
</pre>
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-source_002durl"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-ipv4">update-leap ipv4</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-usage">update-leap usage</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.2 source-url option (-s)</h4>
|
|
|
|
<p><a name="index-update_002dleap_002dsource_002durl-4"></a>
|
|
This is the “the url of the master copy of the leapseconds file” option.
|
|
This option takes a string argument.
|
|
Specify the URL of the master copy to download
|
|
$LEAPSRC
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-ipv4"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-destination">update-leap destination</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-source_002durl">update-leap source-url</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.3 ipv4 option (-4)</h4>
|
|
|
|
<p><a name="index-update_002dleap_002dipv4-5"></a>
|
|
This is the “use only ipv4 addresses for dns name resolution” option.
|
|
|
|
<p class="noindent">This option has some usage constraints. It:
|
|
<ul>
|
|
<li>must not appear in combination with any of the following options:
|
|
ipv6.
|
|
</ul>
|
|
|
|
<p>Force DNS resolution of following host names on the command line
|
|
to the IPv4 namespace.
|
|
_EndOfDoc_;
|
|
;
|
|
|
|
<p>flag =
|
|
name = ipv6;
|
|
flags-cant = ipv4, prefer;
|
|
value = 6;
|
|
descrip = "Use only IPv6 addresses for DNS name resolution";
|
|
doc = <<- _EndOfDoc_
|
|
Force DNS resolution of following host names on the command line
|
|
to the IPv6 namespace.
|
|
_EndOfDoc_;
|
|
;
|
|
|
|
<p>flag =
|
|
name = prefer;
|
|
flags-cant = ipv4, ipv6;
|
|
value = p;
|
|
arg-type = keyword;
|
|
keyword = 4, 6;
|
|
descrip = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
|
|
doc = <<- _EndOfDoc_
|
|
Prefer IPv4 or IPv6 (as specified) addresses, but use either.
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-destination"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-expiration">update-leap expiration</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-ipv4">update-leap ipv4</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.4 destination option (-d)</h4>
|
|
|
|
<p><a name="index-update_002dleap_002ddestination-6"></a>
|
|
This is the “filename on the local system” option.
|
|
This option takes a string argument <span class="file">float</span>.
|
|
The name to use to store the leapfile on the local system.
|
|
$LEAPFILE
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-expiration"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-destination">update-leap destination</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.5 expiration option (-e)</h4>
|
|
|
|
<p><a name="index-update_002dleap_002dexpiration-7"></a>
|
|
This is the “refresh the leapfile this long before it expires” option.
|
|
This option takes a string argument.
|
|
Specify how long before expiration the file is to be refreshed
|
|
Units are required, e.g. "-e 60 days" Note that larger values
|
|
imply more frequent refreshes.
|
|
"$PREFETCH"
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-ntp_002dconf_002dfile"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-expiration">update-leap expiration</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.6 ntp-conf-file option (-f)</h4>
|
|
|
|
<p><a name="index-update_002dleap_002dntp_002dconf_002dfile-8"></a>
|
|
This is the “location of the ntp.conf file” option.
|
|
This option takes a string argument.
|
|
Specify location of ntp.conf (used to make sure leapfile directive is
|
|
present and to default leapfile)
|
|
/etc/ntp.conf
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-force_002dupdate"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-exit-status">update-leap exit status</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.7 force-update option (-F)</h4>
|
|
|
|
<p><a name="index-update_002dleap_002dforce_002dupdate-9"></a>
|
|
This is the “force update of the leapfile” option.
|
|
Force update even if current file is OK and not close to expiring.
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-exit-status"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-Usage">update-leap Usage</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.8 update-leap exit status</h4>
|
|
|
|
<p>One of the following exit values will be returned:
|
|
<dl>
|
|
<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
|
|
<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
|
|
</dl>
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-Usage"></a>Next: <a rel="next" accesskey="n" href="#update_002dleap-Authors">update-leap Authors</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="#update_002dleap-exit-status">update-leap exit status</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.9 update-leap Usage</h4>
|
|
|
|
<div class="node">
|
|
<p><hr>
|
|
<a name="update_002dleap-Authors"></a>Previous: <a rel="previous" accesskey="p" href="#update_002dleap-Usage">update-leap Usage</a>,
|
|
Up: <a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
|
|
<br>
|
|
</div>
|
|
|
|
<h4 class="subsection">0.1.10 update-leap Authors</h4>
|
|
|
|
</body></html>
|
|
|