xref: /freebsd/contrib/ntp/scripts/ntp-wait/ntp-wait.html (revision 052d159a8b83f03d7dc5eb31cd9a9b4a6fe3d9da)
1*052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2*052d159aSCy Schubert<html>
3*052d159aSCy Schubert<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5*052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6*052d159aSCy Schubert<title>Ntp-wait User&rsquo;s Manual</title>
7*052d159aSCy Schubert
8*052d159aSCy Schubert<meta name="description" content="Ntp-wait User&rsquo;s Manual">
9*052d159aSCy Schubert<meta name="keywords" content="Ntp-wait User&rsquo;s Manual">
10*052d159aSCy Schubert<meta name="resource-type" content="document">
11*052d159aSCy Schubert<meta name="distribution" content="global">
12*052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13*052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14*052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15*052d159aSCy Schubert<style type="text/css">
16*052d159aSCy Schubert<!--
17*052d159aSCy Schuberta.summary-letter {text-decoration: none}
18*052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19*052d159aSCy Schubertblockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20*052d159aSCy Schubertblockquote.smallquotation {font-size: smaller}
21*052d159aSCy Schubertdiv.display {margin-left: 3.2em}
22*052d159aSCy Schubertdiv.example {margin-left: 3.2em}
23*052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
24*052d159aSCy Schubertdiv.smalldisplay {margin-left: 3.2em}
25*052d159aSCy Schubertdiv.smallexample {margin-left: 3.2em}
26*052d159aSCy Schubertdiv.smalllisp {margin-left: 3.2em}
27*052d159aSCy Schubertkbd {font-style: oblique}
282b15cb3dSCy Schubertpre.display {font-family: inherit}
292b15cb3dSCy Schubertpre.format {font-family: inherit}
30*052d159aSCy Schubertpre.menu-comment {font-family: serif}
31*052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
322b15cb3dSCy Schubertpre.smalldisplay {font-family: inherit; font-size: smaller}
332b15cb3dSCy Schubertpre.smallexample {font-size: smaller}
34*052d159aSCy Schubertpre.smallformat {font-family: inherit; font-size: smaller}
352b15cb3dSCy Schubertpre.smalllisp {font-size: smaller}
36*052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
37*052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
38*052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
39*052d159aSCy Schubertul.no-bullet {list-style: none}
40*052d159aSCy Schubert-->
41*052d159aSCy Schubert</style>
42*052d159aSCy Schubert
43*052d159aSCy Schubert
442b15cb3dSCy Schubert</head>
45*052d159aSCy Schubert
46*052d159aSCy Schubert<body lang="en">
47*052d159aSCy Schubert<h1 class="settitle" align="center">Ntp-wait User&rsquo;s Manual</h1>
48*052d159aSCy Schubert
49*052d159aSCy Schubert
50*052d159aSCy Schubert
51*052d159aSCy Schubert
52*052d159aSCy Schubert
53*052d159aSCy Schubert<a name="Top"></a>
54*052d159aSCy Schubert<div class="header">
55*052d159aSCy Schubert<p>
56*052d159aSCy SchubertPrevious: <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>
572b15cb3dSCy Schubert</div>
58*052d159aSCy Schubert<h1 class="node-heading">Top</h1>
592b15cb3dSCy Schubert
60*052d159aSCy Schubert<p>This document describes the use of the NTP Project&rsquo;s <code>ntp-wait</code> program.
61*052d159aSCy Schubert</p>
622b15cb3dSCy Schubert<p>If there are time-sensitive applications,
632b15cb3dSCy Schubertthe proper sequence of events is to
642b15cb3dSCy Schubertrun <code>ntpd -g</code> as early as possible,
652b15cb3dSCy Schubertthen invoke all of the non-time-sensitive process,
662b15cb3dSCy Schubertrun <code>ntp-wait</code> to block
67*052d159aSCy Schubertuntil the system&rsquo;s time has stabilized and synchronized,
682b15cb3dSCy Schubertand only then start any applicaitons (like database servers) that require
692b15cb3dSCy Schubertaccurate and stable time.
70*052d159aSCy Schubert</p>
71*052d159aSCy Schubert<p>This document applies to version 4.2.8p13 of <code>ntp-wait</code>.
72*052d159aSCy Schubert</p>
73*052d159aSCy Schubert<a name="SEC_Overview"></a>
74*052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
752b15cb3dSCy Schubert
762b15cb3dSCy Schubert<div class="shortcontents">
77*052d159aSCy Schubert<li><a name="stoc-Invoking-ntp_002dwait" href="#toc-Invoking-ntp_002dwait">1 Invoking ntp-wait</a></li>
78*052d159aSCy Schubert
792b15cb3dSCy Schubert</div>
802b15cb3dSCy Schubert
812b15cb3dSCy Schubert
82*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
83*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; ntp-wait Description:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
84*052d159aSCy Schubert</td></tr>
85*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
87*052d159aSCy Schubert</table>
88*052d159aSCy Schubert
89*052d159aSCy Schubert<hr>
902b15cb3dSCy Schubert<a name="ntp_002dwait-Invocation"></a>
91*052d159aSCy Schubert<div class="header">
92*052d159aSCy Schubert<p>
93*052d159aSCy SchubertUp: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
942b15cb3dSCy Schubert</div>
95*052d159aSCy Schubert<a name="Invoking-ntp_002dwait"></a>
96*052d159aSCy Schubert<h3 class="section">1 Invoking ntp-wait</h3>
97*052d159aSCy Schubert<a name="index-ntp_002dwait"></a>
98*052d159aSCy Schubert<a name="index-Wait-for-ntpd-to-stabilize-the-system-clock"></a>
992b15cb3dSCy Schubert
1002b15cb3dSCy Schubert
1012b15cb3dSCy Schubert
1022b15cb3dSCy Schubert<p><code>ntp-wait</code>
1032b15cb3dSCy Schubertwill send at most
1042b15cb3dSCy Schubert<kbd>num-tries</kbd>
1052b15cb3dSCy Schubertqueries to
1062b15cb3dSCy Schubert<code>ntpd(8)</code>,
1072b15cb3dSCy Schubertsleeping for
1082b15cb3dSCy Schubert<kbd>secs-between-tries</kbd>
1092b15cb3dSCy Schubertafter each status return that says
1102b15cb3dSCy Schubert<code>ntpd(8)</code>
1112b15cb3dSCy Schuberthas not yet produced a synchronized and stable system clock.
112*052d159aSCy Schubert</p>
1132b15cb3dSCy Schubert<p><code>ntp-wait</code>
1142b15cb3dSCy Schubertwill do this quietly, unless the
1152b15cb3dSCy Schubert<code>-v</code>
1162b15cb3dSCy Schubertflag is provided.
1172b15cb3dSCy SchubertThis can be useful at boot time, to delay the boot sequence until after
1182b15cb3dSCy Schubert<kbd>ntpd</kbd> <kbd>-g</kbd>
1192b15cb3dSCy Schuberthas set the time.
120*052d159aSCy Schubert</p>
1212b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
1222b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
123*052d159aSCy Schubert</p>
124*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
125*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
127*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
129*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
131*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
133*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
135*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
137*052d159aSCy Schubert<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*052d159aSCy Schubert</td></tr>
139*052d159aSCy Schubert</table>
1402b15cb3dSCy Schubert
141*052d159aSCy Schubert<hr>
142*052d159aSCy Schubert<a name="ntp_002dwait-usage"></a>
143*052d159aSCy Schubert<div class="header">
144*052d159aSCy Schubert<p>
145*052d159aSCy SchubertNext: <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>
1462b15cb3dSCy Schubert</div>
147*052d159aSCy Schubert<a name="ntp_002dwait-help_002fusage-_0028_002d_002dhelp_0029"></a>
148*052d159aSCy Schubert<h4 class="subsection">1.1 ntp-wait help/usage (<samp>--help</samp>)</h4>
149*052d159aSCy Schubert<a name="index-ntp_002dwait-help"></a>
1502b15cb3dSCy Schubert
151*052d159aSCy Schubert<p>This is the automatically generated usage text for ntp-wait.
152*052d159aSCy Schubert</p>
1532b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
154*052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1552b15cb3dSCy Schubertthe usage text by passing it through a pager program.
1562b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
1572b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
158*052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
1592b15cb3dSCy Schubertwith a status code of 0.
160*052d159aSCy Schubert</p>
161*052d159aSCy Schubert<div class="example">
162*052d159aSCy Schubert<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p13
1632b15cb3dSCy SchubertUSAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
1642b15cb3dSCy Schubert
1652b15cb3dSCy Schubert    -n, --tries=num              Number of times to check ntpd
1662b15cb3dSCy Schubert    -s, --sleep=num              How long to sleep between tries
1672b15cb3dSCy Schubert    -v, --verbose                Be verbose
1682b15cb3dSCy Schubert    -?, --help                   Display usage information and exit
1692b15cb3dSCy Schubert        --more-help              Pass the extended usage text through a pager
1702b15cb3dSCy Schubert
1712b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
1722b15cb3dSCy Schuberthyphen and the flag character.
173*052d159aSCy Schubert</pre></div>
174*052d159aSCy Schubert
175*052d159aSCy Schubert<hr>
176*052d159aSCy Schubert<a name="ntp_002dwait-tries"></a>
177*052d159aSCy Schubert<div class="header">
178*052d159aSCy Schubert<p>
179*052d159aSCy SchubertNext: <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>
1802b15cb3dSCy Schubert</div>
181*052d159aSCy Schubert<a name="tries-option-_0028_002dn_0029"></a>
182*052d159aSCy Schubert<h4 class="subsection">1.2 tries option (-n)</h4>
183*052d159aSCy Schubert<a name="index-ntp_002dwait_002dtries"></a>
1842b15cb3dSCy Schubert
185*052d159aSCy Schubert<p>This is the &ldquo;number of times to check ntpd&rdquo; option.
1862b15cb3dSCy SchubertThis option takes a number argument.
1872b15cb3dSCy Schubert        The maximum number of times we will check <code>ntpd</code> to see if
1882b15cb3dSCy Schubert        it has been able to synchronize and stabilize the system clock.
189*052d159aSCy Schubert</p><hr>
190*052d159aSCy Schubert<a name="ntp_002dwait-sleep"></a>
191*052d159aSCy Schubert<div class="header">
192*052d159aSCy Schubert<p>
193*052d159aSCy SchubertNext: <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>
1942b15cb3dSCy Schubert</div>
195*052d159aSCy Schubert<a name="sleep-option-_0028_002ds_0029"></a>
196*052d159aSCy Schubert<h4 class="subsection">1.3 sleep option (-s)</h4>
197*052d159aSCy Schubert<a name="index-ntp_002dwait_002dsleep"></a>
1982b15cb3dSCy Schubert
199*052d159aSCy Schubert<p>This is the &ldquo;how long to sleep between tries&rdquo; option.
200*052d159aSCy SchubertThis option takes a number argument <samp>secs-between-tries</samp>.
201*052d159aSCy Schubert        We will sleep for <samp>secs-between-tries</samp> after each query
202*052d159aSCy Schubert        of <code>ntpd</code> that returns &quot;the time is not yet stable&quot;.
203*052d159aSCy Schubert</p><hr>
204*052d159aSCy Schubert<a name="ntp_002dwait-verbose"></a>
205*052d159aSCy Schubert<div class="header">
206*052d159aSCy Schubert<p>
207*052d159aSCy SchubertNext: <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>
2082b15cb3dSCy Schubert</div>
209*052d159aSCy Schubert<a name="verbose-option-_0028_002dv_0029"></a>
210*052d159aSCy Schubert<h4 class="subsection">1.4 verbose option (-v)</h4>
211*052d159aSCy Schubert<a name="index-ntp_002dwait_002dverbose"></a>
2122b15cb3dSCy Schubert
213*052d159aSCy Schubert<p>This is the &ldquo;be verbose&rdquo; option.
2142b15cb3dSCy Schubert        By default, <code>ntp-wait</code> is silent.
2152b15cb3dSCy Schubert        With this option, <code>ntp-wait</code> will provide status information.
216*052d159aSCy Schubert</p><hr>
217*052d159aSCy Schubert<a name="ntp_002dwait-exit-status"></a>
218*052d159aSCy Schubert<div class="header">
219*052d159aSCy Schubert<p>
220*052d159aSCy SchubertNext: <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>
2212b15cb3dSCy Schubert</div>
222*052d159aSCy Schubert<a name="ntp_002dwait-exit-status-1"></a>
223*052d159aSCy Schubert<h4 class="subsection">1.5 ntp-wait exit status</h4>
2242b15cb3dSCy Schubert
2252b15cb3dSCy Schubert<p>One of the following exit values will be returned:
226*052d159aSCy Schubert</p><dl compact="compact">
227*052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
228*052d159aSCy Schubert<dd><p>Successful program execution.
229*052d159aSCy Schubert</p></dd>
230*052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
231*052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
232*052d159aSCy Schubert</p></dd>
2332b15cb3dSCy Schubert</dl>
234*052d159aSCy Schubert<hr>
235*052d159aSCy Schubert<a name="ntp_002dwait-Authors"></a>
236*052d159aSCy Schubert<div class="header">
237*052d159aSCy Schubert<p>
238*052d159aSCy SchubertNext: <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>
2392b15cb3dSCy Schubert</div>
240*052d159aSCy Schubert<a name="ntp_002dwait-Authors-1"></a>
241*052d159aSCy Schubert<h4 class="subsection">1.6 ntp-wait Authors</h4>
242*052d159aSCy Schubert<hr>
243*052d159aSCy Schubert<a name="ntp_002dwait-Notes"></a>
244*052d159aSCy Schubert<div class="header">
245*052d159aSCy Schubert<p>
246*052d159aSCy SchubertPrevious: <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>
2472b15cb3dSCy Schubert</div>
248*052d159aSCy Schubert<a name="ntp_002dwait-Notes-1"></a>
249*052d159aSCy Schubert<h4 class="subsection">1.7 ntp-wait Notes</h4>
250*052d159aSCy Schubert<hr>
2512b15cb3dSCy Schubert
2522b15cb3dSCy Schubert
2532b15cb3dSCy Schubert
254*052d159aSCy Schubert</body>
255*052d159aSCy Schubert</html>
256