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