xref: /netbsd-src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.html (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1<html lang="en">
2<head>
3<title>Ntp-wait User's Manual</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Ntp-wait User's Manual">
6<meta name="generator" content="makeinfo 4.8">
7<link title="Top" rel="top" href="#Top">
8<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9<meta http-equiv="Content-Style-Type" content="text/css">
10<style type="text/css"><!--
11  pre.display { font-family:inherit }
12  pre.format  { font-family:inherit }
13  pre.smalldisplay { font-family:inherit; font-size:smaller }
14  pre.smallformat  { font-family:inherit; font-size:smaller }
15  pre.smallexample { font-size:smaller }
16  pre.smalllisp    { font-size:smaller }
17  span.sc    { font-variant:small-caps }
18  span.roman { font-family:serif; font-weight:normal; }
19  span.sansserif { font-family:sans-serif; font-weight:normal; }
20--></style>
21</head>
22<body>
23<h1 class="settitle">Ntp-wait User's Manual</h1>
24<div class="node">
25<p><hr>
26<a name="Top"></a>
27Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Description">ntp-wait Description</a>,
28Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
29Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
30
31</div>
32
33  <p>This document describes the use of the NTP Project's <code>ntp-wait</code> program.
34
35  <p>If there are time-sensitive applications,
36the proper sequence of events is to
37run <code>ntpd -g</code> as early as possible,
38then invoke all of the non-time-sensitive process,
39run <code>ntp-wait</code> to block
40until the system's time has stabilized and synchronized,
41and only then start any applicaitons (like database servers) that require
42accurate and stable time.
43
44  <p>This document applies to version 4.2.8p5 of <code>ntp-wait</code>.
45
46<div class="shortcontents">
47<h2>Short Contents</h2>
48<ul>
49</ul>
50</div>
51
52<ul class="menu">
53<li><a accesskey="1" href="#ntp_002dwait-Description">ntp-wait Description</a>:             Description
54<li><a accesskey="2" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>: 		Invoking ntp-wait
55</ul>
56
57<div class="node">
58<p><hr>
59<a name="ntp-wait-Invocation"></a>
60<a name="ntp_002dwait-Invocation"></a>
61
62
63</div>
64
65<h3 class="section">0.1 Invoking ntp-wait</h3>
66
67<p><a name="index-ntp_002dwait-1"></a><a name="index-Wait-for-ntpd-to-stabilize-the-system-clock-2"></a>
68
69  <p><code>ntp-wait</code>
70will send at most
71<kbd>num-tries</kbd>
72queries to
73<code>ntpd(8)</code>,
74sleeping for
75<kbd>secs-between-tries</kbd>
76after each status return that says
77<code>ntpd(8)</code>
78has not yet produced a synchronized and stable system clock.
79
80  <p><code>ntp-wait</code>
81will do this quietly, unless the
82<code>-v</code>
83flag is provided.
84This can be useful at boot time, to delay the boot sequence until after
85<kbd>ntpd</kbd> <kbd>-g</kbd>
86has set the time.
87
88  <p>This section was generated by <strong>AutoGen</strong>,
89using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
90
91<ul class="menu">
92<li><a accesskey="1" href="#ntp_002dwait-usage">ntp-wait usage</a>:                   ntp-wait help/usage (<samp><span class="option">--help</span></samp>)
93<li><a accesskey="2" href="#ntp_002dwait-tries">ntp-wait tries</a>:                   tries option (-n)
94<li><a accesskey="3" href="#ntp_002dwait-sleep">ntp-wait sleep</a>:                   sleep option (-s)
95<li><a accesskey="4" href="#ntp_002dwait-verbose">ntp-wait verbose</a>:                 verbose option (-v)
96<li><a accesskey="5" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>:             exit status
97<li><a accesskey="6" href="#ntp_002dwait-Authors">ntp-wait Authors</a>:                 Authors
98<li><a accesskey="7" href="#ntp_002dwait-Notes">ntp-wait Notes</a>:                   Notes
99</ul>
100
101<div class="node">
102<p><hr>
103<a name="ntp-wait-usage"></a>
104<a name="ntp_002dwait-usage"></a>
105Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-tries">ntp-wait tries</a>,
106Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
107
108</div>
109
110<h4 class="subsection">0.1.1 ntp-wait help/usage (<samp><span class="option">--help</span></samp>)</h4>
111
112<p><a name="index-ntp_002dwait-help-3"></a>
113This is the automatically generated usage text for ntp-wait.
114
115  <p>The text printed is the same whether selected with the <code>help</code> option
116(<samp><span class="option">--help</span></samp>) or the <code>more-help</code> option (<samp><span class="option">--more-help</span></samp>).  <code>more-help</code> will print
117the usage text by passing it through a pager program.
118<code>more-help</code> is disabled on platforms without a working
119<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
120used to select the program, defaulting to <samp><span class="file">more</span></samp>.  Both will exit
121with a status code of 0.
122
123<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p5
124USAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
125
126    -n, --tries=num              Number of times to check ntpd
127    -s, --sleep=num              How long to sleep between tries
128    -v, --verbose                Be verbose
129    -?, --help                   Display usage information and exit
130        --more-help              Pass the extended usage text through a pager
131
132Options are specified by doubled hyphens and their name or by a single
133hyphen and the flag character.
134</pre>
135  <div class="node">
136<p><hr>
137<a name="ntp-wait-tries"></a>
138<a name="ntp_002dwait-tries"></a>
139Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-sleep">ntp-wait sleep</a>,
140Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-usage">ntp-wait usage</a>,
141Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
142
143</div>
144
145<h4 class="subsection">0.1.2 tries option (-n)</h4>
146
147<p><a name="index-ntp_002dwait_002dtries-4"></a>
148This is the &ldquo;number of times to check ntpd&rdquo; option.
149This option takes a number argument.
150        The maximum number of times we will check <code>ntpd</code> to see if
151        it has been able to synchronize and stabilize the system clock.
152<div class="node">
153<p><hr>
154<a name="ntp-wait-sleep"></a>
155<a name="ntp_002dwait-sleep"></a>
156Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-verbose">ntp-wait verbose</a>,
157Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-tries">ntp-wait tries</a>,
158Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
159
160</div>
161
162<h4 class="subsection">0.1.3 sleep option (-s)</h4>
163
164<p><a name="index-ntp_002dwait_002dsleep-5"></a>
165This is the &ldquo;how long to sleep between tries&rdquo; option.
166This option takes a number argument <samp><span class="file">secs-between-tries</span></samp>.
167        We will sleep for <samp><span class="file">secs-between-tries</span></samp> after each query
168        of <code>ntpd</code> that returns "the time is not yet stable".
169<div class="node">
170<p><hr>
171<a name="ntp-wait-verbose"></a>
172<a name="ntp_002dwait-verbose"></a>
173Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
174Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-sleep">ntp-wait sleep</a>,
175Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
176
177</div>
178
179<h4 class="subsection">0.1.4 verbose option (-v)</h4>
180
181<p><a name="index-ntp_002dwait_002dverbose-6"></a>
182This is the &ldquo;be verbose&rdquo; option.
183        By default, <code>ntp-wait</code> is silent.
184        With this option, <code>ntp-wait</code> will provide status information.
185<div class="node">
186<p><hr>
187<a name="ntp-wait-exit-status"></a>
188<a name="ntp_002dwait-exit-status"></a>
189Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
190Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-verbose">ntp-wait verbose</a>,
191Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
192
193</div>
194
195<h4 class="subsection">0.1.5 ntp-wait exit status</h4>
196
197<p>One of the following exit values will be returned:
198     <dl>
199<dt>`<samp><span class="samp">0 (EXIT_SUCCESS)</span></samp>'<dd>Successful program execution.
200<br><dt>`<samp><span class="samp">1 (EXIT_FAILURE)</span></samp>'<dd>The operation failed or the command syntax was not valid.
201</dl>
202  <div class="node">
203<p><hr>
204<a name="ntp-wait-Authors"></a>
205<a name="ntp_002dwait-Authors"></a>
206Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Notes">ntp-wait Notes</a>,
207Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
208Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
209
210</div>
211
212<h4 class="subsection">0.1.6 ntp-wait Authors</h4>
213
214<div class="node">
215<p><hr>
216<a name="ntp-wait-Notes"></a>
217<a name="ntp_002dwait-Notes"></a>
218Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
219Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
220
221</div>
222
223<h4 class="subsection">0.1.7 ntp-wait Notes</h4>
224
225</body></html>
226
227