1067f5680Schristos<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2067f5680Schristos<html> 3*897be3a4Schristos<!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ --> 48585484eSchristos<head> 5067f5680Schristos<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6067f5680Schristos<title>Ntp-wait User’s Manual</title> 7067f5680Schristos 8067f5680Schristos<meta name="description" content="Ntp-wait User’s Manual"> 9067f5680Schristos<meta name="keywords" content="Ntp-wait User’s Manual"> 10067f5680Schristos<meta name="resource-type" content="document"> 11067f5680Schristos<meta name="distribution" content="global"> 12067f5680Schristos<meta name="Generator" content="makeinfo"> 13067f5680Schristos<link href="#Top" rel="start" title="Top"> 14067f5680Schristos<link href="dir.html#Top" rel="up" title="(dir)"> 15067f5680Schristos<style type="text/css"> 16067f5680Schristos<!-- 17067f5680Schristosa.summary-letter {text-decoration: none} 18067f5680Schristosblockquote.indentedblock {margin-right: 0em} 19067f5680Schristosdiv.display {margin-left: 3.2em} 20067f5680Schristosdiv.example {margin-left: 3.2em} 21067f5680Schristosdiv.lisp {margin-left: 3.2em} 22067f5680Schristoskbd {font-style: oblique} 238585484eSchristospre.display {font-family: inherit} 248585484eSchristospre.format {font-family: inherit} 25067f5680Schristospre.menu-comment {font-family: serif} 26067f5680Schristospre.menu-preformatted {font-family: serif} 27067f5680Schristosspan.nolinebreak {white-space: nowrap} 28067f5680Schristosspan.roman {font-family: initial; font-weight: normal} 29067f5680Schristosspan.sansserif {font-family: sans-serif; font-weight: normal} 30067f5680Schristosul.no-bullet {list-style: none} 31067f5680Schristos--> 32067f5680Schristos</style> 33067f5680Schristos 34067f5680Schristos 358585484eSchristos</head> 36067f5680Schristos 37067f5680Schristos<body lang="en"> 38067f5680Schristos<h1 class="settitle" align="center">Ntp-wait User’s Manual</h1> 39067f5680Schristos 40067f5680Schristos 41067f5680Schristos 42067f5680Schristos 43067f5680Schristos 44*897be3a4Schristos<span id="Top"></span><div class="header"> 45067f5680Schristos<p> 46067f5680SchristosPrevious: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> </p> 478585484eSchristos</div> 48067f5680Schristos<h1 class="node-heading">Top</h1> 498585484eSchristos 50067f5680Schristos<p>This document describes the use of the NTP Project’s <code>ntp-wait</code> program. 51067f5680Schristos</p> 528585484eSchristos<p>If there are time-sensitive applications, 538585484eSchristosthe proper sequence of events is to 548585484eSchristosrun <code>ntpd -g</code> as early as possible, 558585484eSchristosthen invoke all of the non-time-sensitive process, 568585484eSchristosrun <code>ntp-wait</code> to block 57067f5680Schristosuntil the system’s time has stabilized and synchronized, 588585484eSchristosand only then start any applicaitons (like database servers) that require 598585484eSchristosaccurate and stable time. 60067f5680Schristos</p> 61*897be3a4Schristos<p>This document applies to version 4.2.8p18 of <code>ntp-wait</code>. 62067f5680Schristos</p> 63*897be3a4Schristos<span id="SEC_Overview"></span> 64067f5680Schristos<h2 class="shortcontents-heading">Short Table of Contents</h2> 658585484eSchristos 668585484eSchristos<div class="shortcontents"> 67*897be3a4Schristos<li><a id="stoc-Invoking-ntp_002dwait" href="#toc-Invoking-ntp_002dwait">1 Invoking ntp-wait</a></li> 68067f5680Schristos 698585484eSchristos</div> 708585484eSchristos 718585484eSchristos 72067f5680Schristos<table class="menu" border="0" cellspacing="0"> 73*897be3a4Schristos<tr><td align="left" valign="top">• ntp-wait Description</td><td> </td><td align="left" valign="top">Description 74067f5680Schristos</td></tr> 75*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-Invocation" accesskey="2">ntp-wait Invocation</a></td><td> </td><td align="left" valign="top">Invoking ntp-wait 76067f5680Schristos</td></tr> 77067f5680Schristos</table> 78067f5680Schristos 79067f5680Schristos<hr> 80*897be3a4Schristos<span id="ntp_002dwait-Invocation"></span><div class="header"> 81067f5680Schristos<p> 82067f5680SchristosUp: <a href="#Top" accesskey="u" rel="up">Top</a> </p> 838585484eSchristos</div> 84*897be3a4Schristos<span id="Invoking-ntp_002dwait"></span><h3 class="section">1 Invoking ntp-wait</h3> 85*897be3a4Schristos<span id="index-ntp_002dwait"></span> 86*897be3a4Schristos<span id="index-Wait-for-ntpd-to-stabilize-the-system-clock"></span> 878585484eSchristos 888585484eSchristos 898585484eSchristos 908585484eSchristos<p><code>ntp-wait</code> 918585484eSchristoswill send at most 928585484eSchristos<kbd>num-tries</kbd> 938585484eSchristosqueries to 948585484eSchristos<code>ntpd(8)</code>, 958585484eSchristossleeping for 968585484eSchristos<kbd>secs-between-tries</kbd> 978585484eSchristosafter each status return that says 988585484eSchristos<code>ntpd(8)</code> 998585484eSchristoshas not yet produced a synchronized and stable system clock. 100067f5680Schristos</p> 1018585484eSchristos<p><code>ntp-wait</code> 1028585484eSchristoswill do this quietly, unless the 1038585484eSchristos<code>-v</code> 1048585484eSchristosflag is provided. 1058585484eSchristosThis can be useful at boot time, to delay the boot sequence until after 1068585484eSchristos<kbd>ntpd</kbd> <kbd>-g</kbd> 1078585484eSchristoshas set the time. 108067f5680Schristos</p> 1098585484eSchristos<p>This section was generated by <strong>AutoGen</strong>, 1108585484eSchristosusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program. 111067f5680Schristos</p> 112067f5680Schristos<table class="menu" border="0" cellspacing="0"> 113*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-usage" accesskey="1">ntp-wait usage</a></td><td> </td><td align="left" valign="top">ntp-wait help/usage (<samp>--help</samp>) 114067f5680Schristos</td></tr> 115*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-tries" accesskey="2">ntp-wait tries</a></td><td> </td><td align="left" valign="top">tries option (-n) 116067f5680Schristos</td></tr> 117*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-sleep" accesskey="3">ntp-wait sleep</a></td><td> </td><td align="left" valign="top">sleep option (-s) 118067f5680Schristos</td></tr> 119*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-verbose" accesskey="4">ntp-wait verbose</a></td><td> </td><td align="left" valign="top">verbose option (-v) 120067f5680Schristos</td></tr> 121*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-exit-status" accesskey="5">ntp-wait exit status</a></td><td> </td><td align="left" valign="top">exit status 122067f5680Schristos</td></tr> 123*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-Authors" accesskey="6">ntp-wait Authors</a></td><td> </td><td align="left" valign="top">Authors 124067f5680Schristos</td></tr> 125*897be3a4Schristos<tr><td align="left" valign="top">• <a href="#ntp_002dwait-Notes" accesskey="7">ntp-wait Notes</a></td><td> </td><td align="left" valign="top">Notes 126067f5680Schristos</td></tr> 127067f5680Schristos</table> 1288585484eSchristos 129067f5680Schristos<hr> 130*897be3a4Schristos<span id="ntp_002dwait-usage"></span><div class="header"> 131067f5680Schristos<p> 132067f5680SchristosNext: <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> </p> 1338585484eSchristos</div> 134*897be3a4Schristos<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*897be3a4Schristos<span id="index-ntp_002dwait-help"></span> 1368585484eSchristos 137067f5680Schristos<p>This is the automatically generated usage text for ntp-wait. 138067f5680Schristos</p> 1398585484eSchristos<p>The text printed is the same whether selected with the <code>help</code> option 140067f5680Schristos(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>). <code>more-help</code> will print 1418585484eSchristosthe usage text by passing it through a pager program. 1428585484eSchristos<code>more-help</code> is disabled on platforms without a working 1438585484eSchristos<code>fork(2)</code> function. The <code>PAGER</code> environment variable is 144067f5680Schristosused to select the program, defaulting to <samp>more</samp>. Both will exit 1458585484eSchristoswith a status code of 0. 146067f5680Schristos</p> 147067f5680Schristos<div class="example"> 148*897be3a4Schristos<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p18 1498585484eSchristosUSAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 1508585484eSchristos 1518585484eSchristos -n, --tries=num Number of times to check ntpd 1528585484eSchristos -s, --sleep=num How long to sleep between tries 1538585484eSchristos -v, --verbose Be verbose 1548585484eSchristos -?, --help Display usage information and exit 155b8ecfcfeSchristos --more-help Pass the extended usage text through a pager 1568585484eSchristos 1578585484eSchristosOptions are specified by doubled hyphens and their name or by a single 1588585484eSchristoshyphen and the flag character. 159067f5680Schristos</pre></div> 160067f5680Schristos 161067f5680Schristos<hr> 162*897be3a4Schristos<span id="ntp_002dwait-tries"></span><div class="header"> 163067f5680Schristos<p> 164067f5680SchristosNext: <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> </p> 1658585484eSchristos</div> 166*897be3a4Schristos<span id="tries-option-_0028_002dn_0029"></span><h4 class="subsection">1.2 tries option (-n)</h4> 167*897be3a4Schristos<span id="index-ntp_002dwait_002dtries"></span> 1688585484eSchristos 169067f5680Schristos<p>This is the “number of times to check ntpd” option. 1708585484eSchristosThis option takes a number argument. 1718585484eSchristos The maximum number of times we will check <code>ntpd</code> to see if 1728585484eSchristos it has been able to synchronize and stabilize the system clock. 173067f5680Schristos</p><hr> 174*897be3a4Schristos<span id="ntp_002dwait-sleep"></span><div class="header"> 175067f5680Schristos<p> 176067f5680SchristosNext: <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> </p> 1778585484eSchristos</div> 178*897be3a4Schristos<span id="sleep-option-_0028_002ds_0029"></span><h4 class="subsection">1.3 sleep option (-s)</h4> 179*897be3a4Schristos<span id="index-ntp_002dwait_002dsleep"></span> 1808585484eSchristos 181067f5680Schristos<p>This is the “how long to sleep between tries” option. 182067f5680SchristosThis option takes a number argument <samp>secs-between-tries</samp>. 183067f5680Schristos We will sleep for <samp>secs-between-tries</samp> after each query 184067f5680Schristos of <code>ntpd</code> that returns "the time is not yet stable". 185067f5680Schristos</p><hr> 186*897be3a4Schristos<span id="ntp_002dwait-verbose"></span><div class="header"> 187067f5680Schristos<p> 188067f5680SchristosNext: <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> </p> 1898585484eSchristos</div> 190*897be3a4Schristos<span id="verbose-option-_0028_002dv_0029"></span><h4 class="subsection">1.4 verbose option (-v)</h4> 191*897be3a4Schristos<span id="index-ntp_002dwait_002dverbose"></span> 1928585484eSchristos 193067f5680Schristos<p>This is the “be verbose” option. 1948585484eSchristos By default, <code>ntp-wait</code> is silent. 1958585484eSchristos With this option, <code>ntp-wait</code> will provide status information. 196067f5680Schristos</p><hr> 197*897be3a4Schristos<span id="ntp_002dwait-exit-status"></span><div class="header"> 198067f5680Schristos<p> 199067f5680SchristosNext: <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> </p> 2008585484eSchristos</div> 201*897be3a4Schristos<span id="ntp_002dwait-exit-status-1"></span><h4 class="subsection">1.5 ntp-wait exit status</h4> 2028585484eSchristos 2038585484eSchristos<p>One of the following exit values will be returned: 204067f5680Schristos</p><dl compact="compact"> 205067f5680Schristos<dt>‘<samp>0 (EXIT_SUCCESS)</samp>’</dt> 206067f5680Schristos<dd><p>Successful program execution. 207067f5680Schristos</p></dd> 208067f5680Schristos<dt>‘<samp>1 (EXIT_FAILURE)</samp>’</dt> 209067f5680Schristos<dd><p>The operation failed or the command syntax was not valid. 210067f5680Schristos</p></dd> 2118585484eSchristos</dl> 212067f5680Schristos<hr> 213*897be3a4Schristos<span id="ntp_002dwait-Authors"></span><div class="header"> 214067f5680Schristos<p> 215067f5680SchristosNext: <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> </p> 2168585484eSchristos</div> 217*897be3a4Schristos<span id="ntp_002dwait-Authors-1"></span><h4 class="subsection">1.6 ntp-wait Authors</h4> 218067f5680Schristos<hr> 219*897be3a4Schristos<span id="ntp_002dwait-Notes"></span><div class="header"> 220067f5680Schristos<p> 221067f5680SchristosPrevious: <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> </p> 2228585484eSchristos</div> 223*897be3a4Schristos<span id="ntp_002dwait-Notes-1"></span><h4 class="subsection">1.7 ntp-wait Notes</h4> 224067f5680Schristos<hr> 2258585484eSchristos 2268585484eSchristos 2278585484eSchristos 228067f5680Schristos</body> 229067f5680Schristos</html> 230