xref: /freebsd/contrib/ntp/scripts/ntp-wait/ntp-wait.html (revision e17f5b1d307b7b8910d67883e57a9604305906d5)
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6<title>Ntp-wait User&rsquo;s Manual</title>
7
8<meta name="description" content="Ntp-wait User&rsquo;s Manual">
9<meta name="keywords" content="Ntp-wait User&rsquo;s Manual">
10<meta name="resource-type" content="document">
11<meta name="distribution" content="global">
12<meta name="Generator" content="makeinfo">
13<link href="#Top" rel="start" title="Top">
14<link href="dir.html#Top" rel="up" title="(dir)">
15<style type="text/css">
16<!--
17a.summary-letter {text-decoration: none}
18blockquote.indentedblock {margin-right: 0em}
19blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20blockquote.smallquotation {font-size: smaller}
21div.display {margin-left: 3.2em}
22div.example {margin-left: 3.2em}
23div.lisp {margin-left: 3.2em}
24div.smalldisplay {margin-left: 3.2em}
25div.smallexample {margin-left: 3.2em}
26div.smalllisp {margin-left: 3.2em}
27kbd {font-style: oblique}
28pre.display {font-family: inherit}
29pre.format {font-family: inherit}
30pre.menu-comment {font-family: serif}
31pre.menu-preformatted {font-family: serif}
32pre.smalldisplay {font-family: inherit; font-size: smaller}
33pre.smallexample {font-size: smaller}
34pre.smallformat {font-family: inherit; font-size: smaller}
35pre.smalllisp {font-size: smaller}
36span.nolinebreak {white-space: nowrap}
37span.roman {font-family: initial; font-weight: normal}
38span.sansserif {font-family: sans-serif; font-weight: normal}
39ul.no-bullet {list-style: none}
40-->
41</style>
42
43
44</head>
45
46<body lang="en">
47<h1 class="settitle" align="center">Ntp-wait User&rsquo;s Manual</h1>
48
49
50
51
52
53<a name="Top"></a>
54<div class="header">
55<p>
56Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
57</div>
58<h1 class="node-heading">Top</h1>
59
60<p>This document describes the use of the NTP Project&rsquo;s <code>ntp-wait</code> program.
61</p>
62<p>If there are time-sensitive applications,
63the proper sequence of events is to
64run <code>ntpd -g</code> as early as possible,
65then invoke all of the non-time-sensitive process,
66run <code>ntp-wait</code> to block
67until the system&rsquo;s time has stabilized and synchronized,
68and only then start any applicaitons (like database servers) that require
69accurate and stable time.
70</p>
71<p>This document applies to version 4.2.8p15 of <code>ntp-wait</code>.
72</p>
73<a name="SEC_Overview"></a>
74<h2 class="shortcontents-heading">Short Table of Contents</h2>
75
76<div class="shortcontents">
77<li><a name="stoc-Invoking-ntp_002dwait" href="#toc-Invoking-ntp_002dwait">1 Invoking ntp-wait</a></li>
78
79</div>
80
81
82<table class="menu" border="0" cellspacing="0">
83<tr><td align="left" valign="top">&bull; ntp-wait Description:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
84</td></tr>
85<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-Invocation" accesskey="2">ntp-wait Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking ntp-wait
86</td></tr>
87</table>
88
89<hr>
90<a name="ntp_002dwait-Invocation"></a>
91<div class="header">
92<p>
93Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
94</div>
95<a name="Invoking-ntp_002dwait"></a>
96<h3 class="section">1 Invoking ntp-wait</h3>
97<a name="index-ntp_002dwait"></a>
98<a name="index-Wait-for-ntpd-to-stabilize-the-system-clock"></a>
99
100
101
102<p><code>ntp-wait</code>
103will send at most
104<kbd>num-tries</kbd>
105queries to
106<code>ntpd(8)</code>,
107sleeping for
108<kbd>secs-between-tries</kbd>
109after each status return that says
110<code>ntpd(8)</code>
111has not yet produced a synchronized and stable system clock.
112</p>
113<p><code>ntp-wait</code>
114will do this quietly, unless the
115<code>-v</code>
116flag is provided.
117This can be useful at boot time, to delay the boot sequence until after
118<kbd>ntpd</kbd> <kbd>-g</kbd>
119has set the time.
120</p>
121<p>This section was generated by <strong>AutoGen</strong>,
122using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
123</p>
124<table class="menu" border="0" cellspacing="0">
125<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-usage" accesskey="1">ntp-wait usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ntp-wait help/usage (<samp>--help</samp>)
126</td></tr>
127<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-tries" accesskey="2">ntp-wait tries</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">tries option (-n)
128</td></tr>
129<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-sleep" accesskey="3">ntp-wait sleep</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">sleep option (-s)
130</td></tr>
131<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-verbose" accesskey="4">ntp-wait verbose</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">verbose option (-v)
132</td></tr>
133<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-exit-status" accesskey="5">ntp-wait exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
134</td></tr>
135<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-Authors" accesskey="6">ntp-wait Authors</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Authors
136</td></tr>
137<tr><td align="left" valign="top">&bull; <a href="#ntp_002dwait-Notes" accesskey="7">ntp-wait Notes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Notes
138</td></tr>
139</table>
140
141<hr>
142<a name="ntp_002dwait-usage"></a>
143<div class="header">
144<p>
145Next: <a href="#ntp_002dwait-tries" accesskey="n" rel="next">ntp-wait tries</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
146</div>
147<a name="ntp_002dwait-help_002fusage-_0028_002d_002dhelp_0029"></a>
148<h4 class="subsection">1.1 ntp-wait help/usage (<samp>--help</samp>)</h4>
149<a name="index-ntp_002dwait-help"></a>
150
151<p>This is the automatically generated usage text for ntp-wait.
152</p>
153<p>The text printed is the same whether selected with the <code>help</code> option
154(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
155the usage text by passing it through a pager program.
156<code>more-help</code> is disabled on platforms without a working
157<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
158used to select the program, defaulting to <samp>more</samp>.  Both will exit
159with a status code of 0.
160</p>
161<div class="example">
162<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p15
163USAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
164
165    -n, --tries=num              Number of times to check ntpd
166    -s, --sleep=num              How long to sleep between tries
167    -v, --verbose                Be verbose
168    -?, --help                   Display usage information and exit
169        --more-help              Pass the extended usage text through a pager
170
171Options are specified by doubled hyphens and their name or by a single
172hyphen and the flag character.
173</pre></div>
174
175<hr>
176<a name="ntp_002dwait-tries"></a>
177<div class="header">
178<p>
179Next: <a href="#ntp_002dwait-sleep" accesskey="n" rel="next">ntp-wait sleep</a>, Previous: <a href="#ntp_002dwait-usage" accesskey="p" rel="prev">ntp-wait usage</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
180</div>
181<a name="tries-option-_0028_002dn_0029"></a>
182<h4 class="subsection">1.2 tries option (-n)</h4>
183<a name="index-ntp_002dwait_002dtries"></a>
184
185<p>This is the &ldquo;number of times to check ntpd&rdquo; option.
186This option takes a number argument.
187        The maximum number of times we will check <code>ntpd</code> to see if
188        it has been able to synchronize and stabilize the system clock.
189</p><hr>
190<a name="ntp_002dwait-sleep"></a>
191<div class="header">
192<p>
193Next: <a href="#ntp_002dwait-verbose" accesskey="n" rel="next">ntp-wait verbose</a>, Previous: <a href="#ntp_002dwait-tries" accesskey="p" rel="prev">ntp-wait tries</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
194</div>
195<a name="sleep-option-_0028_002ds_0029"></a>
196<h4 class="subsection">1.3 sleep option (-s)</h4>
197<a name="index-ntp_002dwait_002dsleep"></a>
198
199<p>This is the &ldquo;how long to sleep between tries&rdquo; option.
200This option takes a number argument <samp>secs-between-tries</samp>.
201        We will sleep for <samp>secs-between-tries</samp> after each query
202        of <code>ntpd</code> that returns &quot;the time is not yet stable&quot;.
203</p><hr>
204<a name="ntp_002dwait-verbose"></a>
205<div class="header">
206<p>
207Next: <a href="#ntp_002dwait-exit-status" accesskey="n" rel="next">ntp-wait exit status</a>, Previous: <a href="#ntp_002dwait-sleep" accesskey="p" rel="prev">ntp-wait sleep</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
208</div>
209<a name="verbose-option-_0028_002dv_0029"></a>
210<h4 class="subsection">1.4 verbose option (-v)</h4>
211<a name="index-ntp_002dwait_002dverbose"></a>
212
213<p>This is the &ldquo;be verbose&rdquo; option.
214        By default, <code>ntp-wait</code> is silent.
215        With this option, <code>ntp-wait</code> will provide status information.
216</p><hr>
217<a name="ntp_002dwait-exit-status"></a>
218<div class="header">
219<p>
220Next: <a href="#ntp_002dwait-Authors" accesskey="n" rel="next">ntp-wait Authors</a>, Previous: <a href="#ntp_002dwait-verbose" accesskey="p" rel="prev">ntp-wait verbose</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
221</div>
222<a name="ntp_002dwait-exit-status-1"></a>
223<h4 class="subsection">1.5 ntp-wait exit status</h4>
224
225<p>One of the following exit values will be returned:
226</p><dl compact="compact">
227<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
228<dd><p>Successful program execution.
229</p></dd>
230<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
231<dd><p>The operation failed or the command syntax was not valid.
232</p></dd>
233</dl>
234<hr>
235<a name="ntp_002dwait-Authors"></a>
236<div class="header">
237<p>
238Next: <a href="#ntp_002dwait-Notes" accesskey="n" rel="next">ntp-wait Notes</a>, Previous: <a href="#ntp_002dwait-exit-status" accesskey="p" rel="prev">ntp-wait exit status</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
239</div>
240<a name="ntp_002dwait-Authors-1"></a>
241<h4 class="subsection">1.6 ntp-wait Authors</h4>
242<hr>
243<a name="ntp_002dwait-Notes"></a>
244<div class="header">
245<p>
246Previous: <a href="#ntp_002dwait-Authors" accesskey="p" rel="prev">ntp-wait Authors</a>, Up: <a href="#ntp_002dwait-Invocation" accesskey="u" rel="up">ntp-wait Invocation</a> &nbsp; </p>
247</div>
248<a name="ntp_002dwait-Notes-1"></a>
249<h4 class="subsection">1.7 ntp-wait Notes</h4>
250<hr>
251
252
253
254</body>
255</html>
256