-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathntp-wait.html
258 lines (213 loc) · 10.6 KB
/
ntp-wait.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<html lang="en">
<head>
<title>Ntp-wait User's Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Ntp-wait 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">Ntp-wait User's Manual</h1>
<div class="node">
<p><hr>
<a name="Top"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-Description">ntp-wait Description</a>,
Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
</div>
<h2 class="unnumbered">Simple Network Time Protocol User Manual</h2>
<p>This document describes the use of the NTP Project's <code>ntp-wait</code> program.
<p>If there are time-sensitive applications,
the proper sequence of events is to
run <code>ntpd -g</code> as early as possible,
then invoke all of the non-time-sensitive process,
run <code>ntp-wait</code> to block
until the system's time has stabilized and synchronized,
and only then start any applicaitons (like database servers) that require
accurate and stable time.
<p>This document applies to version 4.2.7p368 of <code>ntp-wait</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
<ul>
<a href="#Top">Simple Network Time Protocol User Manual</a>
</ul>
</div>
<ul class="menu">
<li><a accesskey="1" href="#ntp_002dwait-Description">ntp-wait Description</a>: Description
<li><a accesskey="2" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>: Invoking ntp-wait
</ul>
<div class="node">
<p><hr>
<a name="ntp_002dwait-Description"></a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Description</h3>
<p>The <code>ntp-wait</code> program blocks until <code>ntpd</code> is in synchronized state.
This can be useful at boot time, to delay the boot sequence until after
<code>ntpd -g</code> has set the time.
<div class="node">
<p><hr>
<a name="ntp_002dwait-Invocation"></a>
<br>
</div>
<h3 class="section">Invoking ntp-wait</h3>
<p><a name="index-ntp_002dwait-1"></a><a name="index-Wait-for-ntpd-to-stabilize-the-system-clock-2"></a>
<p><code>ntp-wait</code>
will send at most
<kbd>num-tries</kbd>
queries to
<code>ntpd(8)</code>,
sleeping for
<kbd>secs-between-tries</kbd>
after each status return that says
<code>ntpd(8)</code>
has not yet produced a synchronized and stable system clock.
<p><code>ntp-wait</code>
will do this quietly, unless the
<code>-v</code>
flag is provided.
<p>This section was generated by <strong>AutoGen</strong>,
using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
This software is released under the NTP license, <http://ntp.org/license>.
<ul class="menu">
<li><a accesskey="1" href="#ntp_002dwait-usage">ntp-wait usage</a>: ntp-wait help/usage (<span class="option">--help</span>)
<li><a accesskey="2" href="#ntp_002dwait">ntp-wait </a>: option (-n)
<li><a accesskey="3" href="#ntp_002dwait">ntp-wait </a>: option (-s)
<li><a accesskey="4" href="#ntp_002dwait">ntp-wait </a>: option (-v)
<li><a accesskey="5" href="#ntp_002dwait-config">ntp-wait config</a>: presetting/configuring ntp-wait
<li><a accesskey="6" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>: exit status
<li><a accesskey="7" href="#ntp_002dwait-Authors">ntp-wait Authors</a>: Authors
<li><a accesskey="8" href="#ntp_002dwait-Notes">ntp-wait Notes</a>: Notes
</ul>
<div class="node">
<p><hr>
<a name="ntp_002dwait-usage"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait">ntp-wait</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">ntp-wait help/usage (<span class="option">--help</span>)</h4>
<p><a name="index-ntp_002dwait-help-3"></a>
This is the automatically generated usage text for ntp-wait.
<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">/deacon/backroom/snaps/ntp-dev/A.snap/scripts/ntp-wait version [unknown] calling Getopt::Std::getopts (version 1.05 [paranoid]),
running under Perl version 5.8.8.
Usage: ntp-wait [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...]
The following single-character options are accepted:
With arguments: -n -s
Boolean (without arguments): -v
Options may be merged together. -- stops processing of options.
Space is not required between options and their arguments.
[Now continuing due to backward compatibility and excessive paranoia.
See ``perldoc Getopt::Std'' about $Getopt::Std::STANDARD_HELP_VERSION.]
</pre>
<div class="node">
<p><hr>
<a name="ntp_002dwait"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-config">ntp-wait config</a>,
Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait">ntp-wait</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">option (-n)</h4>
<p><a name="index-ntp_002dwait_002d-4"></a>
This is the “number of times to check ntpd” option.
This option takes an argument number <span class="file">num-tries</span>.
The maximum number of times we will check <code>ntpd</code> to see if
it has been able to synchronize and stabilize the system clock.
<div class="node">
<p><hr>
<a name="ntp_002dwait"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-config">ntp-wait config</a>,
Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait">ntp-wait</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">option (-s)</h4>
<p><a name="index-ntp_002dwait_002d-5"></a>
This is the “how long to sleep between tries” option.
This option takes an argument number <span class="file">secs-between-tries</span>.
We will sleep for <span class="file">secs-between-tries</span> after each query
of <code>ntpd</code> that returns "the time is not yet stable".
<div class="node">
<p><hr>
<a name="ntp_002dwait"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-config">ntp-wait config</a>,
Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait">ntp-wait</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">option (-v)</h4>
<p><a name="index-ntp_002dwait_002d-6"></a>
This is the “be verbose” option.
By default, <code>ntp-wait</code> is silent.
With this option, <code>ntp-wait</code> will provide status information.
<div class="node">
<p><hr>
<a name="ntp_002dwait-config"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait">ntp-wait</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">presetting/configuring ntp-wait</h4>
<p>Any option that is not marked as <i>not presettable</i> may be preset by
loading values from environment variables named <code>NTP-WAIT</code> and <code>NTP-WAIT_<OPTION_NAME></code>. <code><OPTION_NAME></code> must be one of
the options listed above in upper case and segmented with underscores.
The <code>NTP-WAIT</code> variable will be tokenized and parsed like
the command line. The remaining variables are tested for existence and their
values are treated like option arguments.
<p>The command line options relating to configuration and/or usage help are:
<h5 class="subsubheading">version (-)</h5>
<p>Print the program version to standard out, optionally with licensing
information, then exit 0. The optional argument specifies how much licensing
detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
Only the first letter of the argument is examined:
<dl>
<dt><span class="samp">version</span><dd>Only print the version. This is the default.
<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
</dl>
<div class="node">
<p><hr>
<a name="ntp_002dwait-exit-status"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait-config">ntp-wait config</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">ntp-wait 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="ntp_002dwait-Authors"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-Notes">ntp-wait Notes</a>,
Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">ntp-wait Authors</h4>
<div class="node">
<p><hr>
<a name="ntp_002dwait-Notes"></a>Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
<br>
</div>
<h4 class="subsection">ntp-wait Notes</h4>
</body></html>