xref: /freebsd/contrib/ntp/scripts/update-leap/invoke-update-leap.texi (revision b1b73fc4c9924c4ca2f94b76155a0895373a0b5c)
1@node update-leap Invocation
2@section Invoking update-leap
3@pindex update-leap
4@cindex leap-seconds file manager/updater
5@ignore
6#
7# EDIT THIS FILE WITH CAUTION  (invoke-update-leap.texi)
8#
9# It has been AutoGen-ed  April 26, 2016 at 08:24:50 PM by AutoGen 5.18.5
10# From the definitions    update-leap-opts.def
11# and the template file   agtexi-cmd.tpl
12@end ignore
13
14
15
16@code{update-leap}
17will validate the file currently on the local system
18and if necessary, updates leap-second definition file.
19
20Ordinarily, the file is found using the "leapfile" directive in
21@code{ntp.conf(5)}.
22However, an alternate location can be specified on the command line.
23
24If the file does not exist, is not valid, has expired, or is expiring soon,
25a new copy will be downloaded.  If the new copy validates, it is installed and
26NTP is (optionally) restarted.
27
28If the current file is acceptable, no download or restart occurs.
29
30-c can also be used to invoke another script to perform administrative
31functions, e.g. to copy the file to other local systems.
32.PP
33This can be run as a cron job.  As the file is rarely updated, and leap
34seconds are announced at least one month in advance (usually longer), it
35need not be run more frequently than about once every three weeks.
36.PP
37For cron-friendly behavior, define CRONJOB=1 in the crontab.
38.PP
39This script depends on$REQUIREDCMDS
40
41This section was generated by @strong{AutoGen},
42using the @code{agtexi-cmd} template and the option descriptions for the @code{update-leap} program.
43
44@menu
45* update-leap usage::                  update-leap help/usage (@option{--help})
46* update-leap source-url::             source-url option (-s)
47* update-leap ipv4::                   ipv4 option (-4)
48* update-leap destination::            destination option (-d)
49* update-leap expiration::             expiration option (-e)
50* update-leap ntp-conf-file::          ntp-conf-file option (-f)
51* update-leap force-update::           force-update option (-F)
52* update-leap exit status::            exit status
53* update-leap Usage::                  Usage
54* update-leap Authors::                Authors
55@end menu
56
57@node update-leap usage
58@subsection update-leap help/usage (@option{--help})
59@cindex update-leap help
60
61This is the automatically generated usage text for update-leap.
62
63The text printed is the same whether selected with the @code{help} option
64(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
65the usage text by passing it through a pager program.
66@code{more-help} is disabled on platforms without a working
67@code{fork(2)} function.  The @code{PAGER} environment variable is
68used to select the program, defaulting to @file{more}.  Both will exit
69with a status code of 0.
70
71@exampleindent 0
72@example
73    update-leap
74        Usage: $0 [options] [leapfile]
75
76        Verifies and if necessary, updates leap-second definition file
77
78        All arguments are optional: Default (or current value) shown: -s
79        Specify the URL of the master copy to download $LEAPSRC -d Specify
80        the filename on the local system $LEAPFILE -e Specify how long (in
81        days) before expiration the file is to be refreshed. Note that
82        larger values imply more frequent refreshes. "$PREFETCH" -f Specify
83        location of ntp.conf (used to make sure leapfile directive is
84        present and to default leapfile) $NTPCONF -F Force update even if
85        current file is OK and not close to expiring. -r Specify number of
86        times to retry on get failure $MAXTRIES -i Specify number of minutes
87        between retries $INTERVAL -l Use syslog for output (Implied if
88        CRONJOB is set) -L Don't use syslog for output -P Specify the syslog
89        facility for logging $LOGFAC -t Name of temporary file used in
90        validation $TMPFILE -q Only report errors to stdout -v Verbose
91        output
92
93        The following options are not (yet) implemented in the perl version:
94        -4 Use only IPv4 -6 Use only IPv6 -c Command to restart NTP after
95        installing a new file <none> - ntpd checks file daily -p 4|6 Prefer
96        IPv4 or IPv6 (as specified) addresses, but use either -z Specify
97        path for utilities $PATHLIST -Z Only use system path
98
99        $0 will validate the file currently on the local system
100
101        Ordinarily, the file is found using the "leapfile" directive in
102        $NTPCONF. However, an alternate location can be specified on the
103        command line.
104
105        If the file does not exist, is not valid, has expired, or is
106        expiring soon, a new copy will be downloaded. If the new copy
107        validates, it is installed and NTP is (optionally) restarted.
108
109        If the current file is acceptable, no download or restart occurs.
110
111        -c can also be used to invoke another script to perform
112        administrative functions, e.g. to copy the file to other local
113        systems.
114
115        This can be run as a cron job. As the file is rarely updated, and
116        leap seconds are announced at least one month in advance (usually
117        longer), it need not be run more frequently than about once every
118        three weeks.
119
120        For cron-friendly behavior, define CRONJOB=1 in the crontab.
121
122        Version $VERSION
123@end example
124@exampleindent 4
125
126@node update-leap source-url
127@subsection source-url option (-s)
128@cindex update-leap-source-url
129
130This is the ``the url of the master copy of the leapseconds file'' option.
131This option takes a string argument.
132Specify the URL of the master copy to download
133$LEAPSRC
134@node update-leap ipv4
135@subsection ipv4 option (-4)
136@cindex update-leap-ipv4
137
138This is the ``use only ipv4 addresses for dns name resolution'' option.
139
140@noindent
141This option has some usage constraints.  It:
142@itemize @bullet
143@item
144must not appear in combination with any of the following options:
145ipv6.
146@end itemize
147
148        Force DNS resolution of following host names on the command line
149        to the IPv4 namespace.
150        _EndOfDoc_;
151};
152
153flag = {
154    name      = ipv6;
155    flags-cant = ipv4, prefer;
156    value     = 6;
157    descrip   = "Use only IPv6 addresses for DNS name resolution";
158    doc = <<-  _EndOfDoc_
159        Force DNS resolution of following host names on the command line
160        to the IPv6 namespace.
161        _EndOfDoc_;
162};
163
164flag = {
165    name        = prefer;
166    flags-cant	= ipv4, ipv6;
167    value	= p;
168    arg-type    = keyword;
169    keyword	= 4, 6;
170    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
171    doc         = <<-  _EndOfDoc_
172Prefer IPv4 or IPv6 (as specified) addresses, but use either.
173@node update-leap destination
174@subsection destination option (-d)
175@cindex update-leap-destination
176
177This is the ``filename on the local system'' option.
178This option takes a string argument @file{float}.
179The name to use to store the leapfile on the local system.
180$LEAPFILE
181@node update-leap expiration
182@subsection expiration option (-e)
183@cindex update-leap-expiration
184
185This is the ``refresh the leapfile this long before it expires'' option.
186This option takes a string argument.
187Specify how long before expiration the file is to be refreshed
188Units are required, e.g. "-e 60 days"  Note that larger values
189imply more frequent refreshes.
190"$PREFETCH"
191@node update-leap ntp-conf-file
192@subsection ntp-conf-file option (-f)
193@cindex update-leap-ntp-conf-file
194
195This is the ``location of the ntp.conf file'' option.
196This option takes a string argument.
197Specify location of ntp.conf (used to make sure leapfile directive is
198present and to default  leapfile)
199/etc/ntp.conf
200@node update-leap force-update
201@subsection force-update option (-F)
202@cindex update-leap-force-update
203
204This is the ``force update of the leapfile'' option.
205Force update even if current file is OK and not close to expiring.
206@node update-leap exit status
207@subsection update-leap exit status
208
209One of the following exit values will be returned:
210@table @samp
211@item 0 (EXIT_SUCCESS)
212Successful program execution.
213@item 1 (EXIT_FAILURE)
214The operation failed or the command syntax was not valid.
215@end table
216@node update-leap Usage
217@subsection update-leap Usage
218@node update-leap Authors
219@subsection update-leap Authors
220