xref: /freebsd-src/contrib/ntp/scripts/ntp-wait/ntp-wait.html (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2052d159aSCy Schubert<html>
3a466cc55SCy Schubert<!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6052d159aSCy Schubert<title>Ntp-wait User&rsquo;s Manual</title>
7052d159aSCy Schubert
8052d159aSCy Schubert<meta name="description" content="Ntp-wait User&rsquo;s Manual">
9052d159aSCy Schubert<meta name="keywords" content="Ntp-wait User&rsquo;s Manual">
10052d159aSCy Schubert<meta name="resource-type" content="document">
11052d159aSCy Schubert<meta name="distribution" content="global">
12052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15052d159aSCy Schubert<style type="text/css">
16052d159aSCy Schubert<!--
17052d159aSCy Schuberta.summary-letter {text-decoration: none}
18052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19052d159aSCy Schubertdiv.display {margin-left: 3.2em}
20052d159aSCy Schubertdiv.example {margin-left: 3.2em}
21052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
22052d159aSCy Schubertkbd {font-style: oblique}
232b15cb3dSCy Schubertpre.display {font-family: inherit}
242b15cb3dSCy Schubertpre.format {font-family: inherit}
25052d159aSCy Schubertpre.menu-comment {font-family: serif}
26052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
27052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
28052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
29052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
30052d159aSCy Schubertul.no-bullet {list-style: none}
31052d159aSCy Schubert-->
32052d159aSCy Schubert</style>
33052d159aSCy Schubert
34052d159aSCy Schubert
352b15cb3dSCy Schubert</head>
36052d159aSCy Schubert
37052d159aSCy Schubert<body lang="en">
38052d159aSCy Schubert<h1 class="settitle" align="center">Ntp-wait User&rsquo;s Manual</h1>
39052d159aSCy Schubert
40052d159aSCy Schubert
41052d159aSCy Schubert
42052d159aSCy Schubert
43052d159aSCy Schubert
44a466cc55SCy Schubert<span id="Top"></span><div class="header">
45052d159aSCy Schubert<p>
46052d159aSCy 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>
472b15cb3dSCy Schubert</div>
48052d159aSCy Schubert<h1 class="node-heading">Top</h1>
492b15cb3dSCy Schubert
50052d159aSCy Schubert<p>This document describes the use of the NTP Project&rsquo;s <code>ntp-wait</code> program.
51052d159aSCy Schubert</p>
522b15cb3dSCy Schubert<p>If there are time-sensitive applications,
532b15cb3dSCy Schubertthe proper sequence of events is to
542b15cb3dSCy Schubertrun <code>ntpd -g</code> as early as possible,
552b15cb3dSCy Schubertthen invoke all of the non-time-sensitive process,
562b15cb3dSCy Schubertrun <code>ntp-wait</code> to block
57052d159aSCy Schubertuntil the system&rsquo;s time has stabilized and synchronized,
582b15cb3dSCy Schubertand only then start any applicaitons (like database servers) that require
592b15cb3dSCy Schubertaccurate and stable time.
60052d159aSCy Schubert</p>
61*f5f40dd6SCy Schubert<p>This document applies to version 4.2.8p18 of <code>ntp-wait</code>.
62052d159aSCy Schubert</p>
63a466cc55SCy Schubert<span id="SEC_Overview"></span>
64052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
652b15cb3dSCy Schubert
662b15cb3dSCy Schubert<div class="shortcontents">
67a466cc55SCy Schubert<li><a id="stoc-Invoking-ntp_002dwait" href="#toc-Invoking-ntp_002dwait">1 Invoking ntp-wait</a></li>
68052d159aSCy Schubert
692b15cb3dSCy Schubert</div>
702b15cb3dSCy Schubert
712b15cb3dSCy Schubert
72052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
73a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; ntp-wait Description</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
74052d159aSCy Schubert</td></tr>
75a466cc55SCy 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
76052d159aSCy Schubert</td></tr>
77052d159aSCy Schubert</table>
78052d159aSCy Schubert
79052d159aSCy Schubert<hr>
80a466cc55SCy Schubert<span id="ntp_002dwait-Invocation"></span><div class="header">
81052d159aSCy Schubert<p>
82052d159aSCy SchubertUp: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
832b15cb3dSCy Schubert</div>
84a466cc55SCy Schubert<span id="Invoking-ntp_002dwait"></span><h3 class="section">1 Invoking ntp-wait</h3>
85a466cc55SCy Schubert<span id="index-ntp_002dwait"></span>
86a466cc55SCy Schubert<span id="index-Wait-for-ntpd-to-stabilize-the-system-clock"></span>
872b15cb3dSCy Schubert
882b15cb3dSCy Schubert
892b15cb3dSCy Schubert
902b15cb3dSCy Schubert<p><code>ntp-wait</code>
912b15cb3dSCy Schubertwill send at most
922b15cb3dSCy Schubert<kbd>num-tries</kbd>
932b15cb3dSCy Schubertqueries to
942b15cb3dSCy Schubert<code>ntpd(8)</code>,
952b15cb3dSCy Schubertsleeping for
962b15cb3dSCy Schubert<kbd>secs-between-tries</kbd>
972b15cb3dSCy Schubertafter each status return that says
982b15cb3dSCy Schubert<code>ntpd(8)</code>
992b15cb3dSCy Schuberthas not yet produced a synchronized and stable system clock.
100052d159aSCy Schubert</p>
1012b15cb3dSCy Schubert<p><code>ntp-wait</code>
1022b15cb3dSCy Schubertwill do this quietly, unless the
1032b15cb3dSCy Schubert<code>-v</code>
1042b15cb3dSCy Schubertflag is provided.
1052b15cb3dSCy SchubertThis can be useful at boot time, to delay the boot sequence until after
1062b15cb3dSCy Schubert<kbd>ntpd</kbd> <kbd>-g</kbd>
1072b15cb3dSCy Schuberthas set the time.
108052d159aSCy Schubert</p>
1092b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
1102b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
111052d159aSCy Schubert</p>
112052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
113a466cc55SCy 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>)
114052d159aSCy Schubert</td></tr>
115a466cc55SCy 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)
116052d159aSCy Schubert</td></tr>
117a466cc55SCy 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)
118052d159aSCy Schubert</td></tr>
119a466cc55SCy 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)
120052d159aSCy Schubert</td></tr>
121a466cc55SCy 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
122052d159aSCy Schubert</td></tr>
123a466cc55SCy 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
124052d159aSCy Schubert</td></tr>
125a466cc55SCy 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
126052d159aSCy Schubert</td></tr>
127052d159aSCy Schubert</table>
1282b15cb3dSCy Schubert
129052d159aSCy Schubert<hr>
130a466cc55SCy Schubert<span id="ntp_002dwait-usage"></span><div class="header">
131052d159aSCy Schubert<p>
132052d159aSCy 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>
1332b15cb3dSCy Schubert</div>
134a466cc55SCy Schubert<span id="ntp_002dwait-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.1 ntp-wait help/usage (<samp>--help</samp>)</h4>
135a466cc55SCy Schubert<span id="index-ntp_002dwait-help"></span>
1362b15cb3dSCy Schubert
137052d159aSCy Schubert<p>This is the automatically generated usage text for ntp-wait.
138052d159aSCy Schubert</p>
1392b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
140052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1412b15cb3dSCy Schubertthe usage text by passing it through a pager program.
1422b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
1432b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
144052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
1452b15cb3dSCy Schubertwith a status code of 0.
146052d159aSCy Schubert</p>
147052d159aSCy Schubert<div class="example">
148*f5f40dd6SCy Schubert<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p18
1492b15cb3dSCy SchubertUSAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
1502b15cb3dSCy Schubert
1512b15cb3dSCy Schubert    -n, --tries=num              Number of times to check ntpd
1522b15cb3dSCy Schubert    -s, --sleep=num              How long to sleep between tries
1532b15cb3dSCy Schubert    -v, --verbose                Be verbose
1542b15cb3dSCy Schubert    -?, --help                   Display usage information and exit
1552b15cb3dSCy Schubert        --more-help              Pass the extended usage text through a pager
1562b15cb3dSCy Schubert
1572b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
1582b15cb3dSCy Schuberthyphen and the flag character.
159052d159aSCy Schubert</pre></div>
160052d159aSCy Schubert
161052d159aSCy Schubert<hr>
162a466cc55SCy Schubert<span id="ntp_002dwait-tries"></span><div class="header">
163052d159aSCy Schubert<p>
164052d159aSCy 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>
1652b15cb3dSCy Schubert</div>
166a466cc55SCy Schubert<span id="tries-option-_0028_002dn_0029"></span><h4 class="subsection">1.2 tries option (-n)</h4>
167a466cc55SCy Schubert<span id="index-ntp_002dwait_002dtries"></span>
1682b15cb3dSCy Schubert
169052d159aSCy Schubert<p>This is the &ldquo;number of times to check ntpd&rdquo; option.
1702b15cb3dSCy SchubertThis option takes a number argument.
1712b15cb3dSCy Schubert        The maximum number of times we will check <code>ntpd</code> to see if
1722b15cb3dSCy Schubert        it has been able to synchronize and stabilize the system clock.
173052d159aSCy Schubert</p><hr>
174a466cc55SCy Schubert<span id="ntp_002dwait-sleep"></span><div class="header">
175052d159aSCy Schubert<p>
176052d159aSCy 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>
1772b15cb3dSCy Schubert</div>
178a466cc55SCy Schubert<span id="sleep-option-_0028_002ds_0029"></span><h4 class="subsection">1.3 sleep option (-s)</h4>
179a466cc55SCy Schubert<span id="index-ntp_002dwait_002dsleep"></span>
1802b15cb3dSCy Schubert
181052d159aSCy Schubert<p>This is the &ldquo;how long to sleep between tries&rdquo; option.
182052d159aSCy SchubertThis option takes a number argument <samp>secs-between-tries</samp>.
183052d159aSCy Schubert        We will sleep for <samp>secs-between-tries</samp> after each query
184052d159aSCy Schubert        of <code>ntpd</code> that returns &quot;the time is not yet stable&quot;.
185052d159aSCy Schubert</p><hr>
186a466cc55SCy Schubert<span id="ntp_002dwait-verbose"></span><div class="header">
187052d159aSCy Schubert<p>
188052d159aSCy 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>
1892b15cb3dSCy Schubert</div>
190a466cc55SCy Schubert<span id="verbose-option-_0028_002dv_0029"></span><h4 class="subsection">1.4 verbose option (-v)</h4>
191a466cc55SCy Schubert<span id="index-ntp_002dwait_002dverbose"></span>
1922b15cb3dSCy Schubert
193052d159aSCy Schubert<p>This is the &ldquo;be verbose&rdquo; option.
1942b15cb3dSCy Schubert        By default, <code>ntp-wait</code> is silent.
1952b15cb3dSCy Schubert        With this option, <code>ntp-wait</code> will provide status information.
196052d159aSCy Schubert</p><hr>
197a466cc55SCy Schubert<span id="ntp_002dwait-exit-status"></span><div class="header">
198052d159aSCy Schubert<p>
199052d159aSCy 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>
2002b15cb3dSCy Schubert</div>
201a466cc55SCy Schubert<span id="ntp_002dwait-exit-status-1"></span><h4 class="subsection">1.5 ntp-wait exit status</h4>
2022b15cb3dSCy Schubert
2032b15cb3dSCy Schubert<p>One of the following exit values will be returned:
204052d159aSCy Schubert</p><dl compact="compact">
205052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
206052d159aSCy Schubert<dd><p>Successful program execution.
207052d159aSCy Schubert</p></dd>
208052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
209052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
210052d159aSCy Schubert</p></dd>
2112b15cb3dSCy Schubert</dl>
212052d159aSCy Schubert<hr>
213a466cc55SCy Schubert<span id="ntp_002dwait-Authors"></span><div class="header">
214052d159aSCy Schubert<p>
215052d159aSCy 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>
2162b15cb3dSCy Schubert</div>
217a466cc55SCy Schubert<span id="ntp_002dwait-Authors-1"></span><h4 class="subsection">1.6 ntp-wait Authors</h4>
218052d159aSCy Schubert<hr>
219a466cc55SCy Schubert<span id="ntp_002dwait-Notes"></span><div class="header">
220052d159aSCy Schubert<p>
221052d159aSCy 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>
2222b15cb3dSCy Schubert</div>
223a466cc55SCy Schubert<span id="ntp_002dwait-Notes-1"></span><h4 class="subsection">1.7 ntp-wait Notes</h4>
224052d159aSCy Schubert<hr>
2252b15cb3dSCy Schubert
2262b15cb3dSCy Schubert
2272b15cb3dSCy Schubert
228052d159aSCy Schubert</body>
229052d159aSCy Schubert</html>
230