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