ntp-wait.html revision 275970
1193323Sed<html lang="en"> 2193323Sed<head> 3193323Sed<title>Ntp-wait User's Manual</title> 4193323Sed<meta http-equiv="Content-Type" content="text/html"> 5193323Sed<meta name="description" content="Ntp-wait User's Manual"> 6193323Sed<meta name="generator" content="makeinfo 4.7"> 7193323Sed<link title="Top" rel="top" href="#Top"> 8193323Sed<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 9193323Sed<meta http-equiv="Content-Style-Type" content="text/css"> 10193323Sed<style type="text/css"><!-- 11193323Sed pre.display { font-family:inherit } 12193323Sed pre.format { font-family:inherit } 13193323Sed pre.smalldisplay { font-family:inherit; font-size:smaller } 14193323Sed pre.smallformat { font-family:inherit; font-size:smaller } 15193323Sed pre.smallexample { font-size:smaller } 16193323Sed pre.smalllisp { font-size:smaller } 17193323Sed span.sc { font-variant:small-caps } 18193323Sed span.roman { font-family: serif; font-weight: normal; } 19193323Sed--></style> 20193323Sed</head> 21193323Sed<body> 22193323Sed<h1 class="settitle">Ntp-wait User's Manual</h1> 23193323Sed<div class="node"> 24193323Sed<p><hr> 25193323Sed<a name="Top"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-Description">ntp-wait Description</a>, 26193323SedPrevious: <a rel="previous" accesskey="p" href="#dir">(dir)</a>, 27193323SedUp: <a rel="up" accesskey="u" href="#dir">(dir)</a> 28193323Sed<br> 29193323Sed</div> 30199989Srdivacky 31199989Srdivacky <p>This document describes the use of the NTP Project's <code>ntp-wait</code> program. 32199989Srdivacky 33199989Srdivacky <p>If there are time-sensitive applications, 34199989Srdivackythe proper sequence of events is to 35199989Srdivackyrun <code>ntpd -g</code> as early as possible, 36199989Srdivackythen invoke all of the non-time-sensitive process, 37199989Srdivackyrun <code>ntp-wait</code> to block 38199989Srdivackyuntil the system's time has stabilized and synchronized, 39208599Srdivackyand only then start any applicaitons (like database servers) that require 40199989Srdivackyaccurate and stable time. 41193323Sed 42193323Sed <p>This document applies to version 4.2.8 of <code>ntp-wait</code>. 43193323Sed 44193323Sed<div class="shortcontents"> 45234353Sdim<h2>Short Contents</h2> 46193323Sed<ul> 47193323Sed</ul> 48193323Sed</div> 49193323Sed 50193323Sed<ul class="menu"> 51234353Sdim<li><a accesskey="1" href="#ntp_002dwait-Description">ntp-wait Description</a>: Description 52193323Sed<li><a accesskey="2" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>: Invoking ntp-wait 53193323Sed</ul> 54193323Sed 55193323Sed<div class="node"> 56193323Sed<p><hr> 57193323Sed<a name="ntp_002dwait-Invocation"></a> 58193323Sed<br> 59193323Sed</div> 60193323Sed 61193323Sed<h3 class="section">0.1 Invoking ntp-wait</h3> 62208599Srdivacky 63208599Srdivacky<p><a name="index-ntp_002dwait-1"></a><a name="index-Wait-for-ntpd-to-stabilize-the-system-clock-2"></a> 64234353Sdim 65208599Srdivacky <p><code>ntp-wait</code> 66208599Srdivackywill send at most 67208599Srdivacky<kbd>num-tries</kbd> 68193323Sedqueries to 69193323Sed<code>ntpd(8)</code>, 70193323Sedsleeping for 71234353Sdim<kbd>secs-between-tries</kbd> 72193323Sedafter each status return that says 73193323Sed<code>ntpd(8)</code> 74193323Sedhas not yet produced a synchronized and stable system clock. 75193323Sed 76193323Sed <p><code>ntp-wait</code> 77193323Sedwill do this quietly, unless the 78234353Sdim<code>-v</code> 79193323Sedflag is provided. 80193323SedThis can be useful at boot time, to delay the boot sequence until after 81193323Sed<kbd>ntpd</kbd> <kbd>-g</kbd> 82249423Sdimhas set the time. 83249423Sdim 84249423Sdim <p>This section was generated by <strong>AutoGen</strong>, 85249423Sdimusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program. 86249423Sdim 87193323Sed<ul class="menu"> 88193323Sed<li><a accesskey="1" href="#ntp_002dwait-usage">ntp-wait usage</a>: ntp-wait help/usage (<span class="option">--help</span>) 89193323Sed<li><a accesskey="2" href="#ntp_002dwait-tries">ntp-wait tries</a>: tries option (-n) 90234353Sdim<li><a accesskey="3" href="#ntp_002dwait-sleep">ntp-wait sleep</a>: sleep option (-s) 91234353Sdim<li><a accesskey="4" href="#ntp_002dwait-verbose">ntp-wait verbose</a>: verbose option (-v) 92193323Sed<li><a accesskey="5" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>: exit status 93193323Sed<li><a accesskey="6" href="#ntp_002dwait-Authors">ntp-wait Authors</a>: Authors 94193323Sed<li><a accesskey="7" href="#ntp_002dwait-Notes">ntp-wait Notes</a>: Notes 95193323Sed</ul> 96193323Sed 97221345Sdim<div class="node"> 98234353Sdim<p><hr> 99234353Sdim<a name="ntp_002dwait-usage"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-tries">ntp-wait tries</a>, 100193323SedUp: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 101193323Sed<br> 102193323Sed</div> 103193323Sed 104193323Sed<h4 class="subsection">0.1.1 ntp-wait help/usage (<span class="option">--help</span>)</h4> 105193323Sed 106234353Sdim<p><a name="index-ntp_002dwait-help-3"></a> 107193323SedThis is the automatically generated usage text for ntp-wait. 108193323Sed 109193323Sed <p>The text printed is the same whether selected with the <code>help</code> option 110193323Sed(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print 111193323Sedthe usage text by passing it through a pager program. 112193323Sed<code>more-help</code> is disabled on platforms without a working 113193323Sed<code>fork(2)</code> function. The <code>PAGER</code> environment variable is 114234353Sdimused to select the program, defaulting to <span class="file">more</span>. Both will exit 115193323Sedwith a status code of 0. 116193323Sed 117193323Sed<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8 118193323SedUSAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 119193323Sed 120193323Sed -n, --tries=num Number of times to check ntpd 121193323Sed -s, --sleep=num How long to sleep between tries 122234353Sdim -v, --verbose Be verbose 123193323Sed -?, --help Display usage information and exit 124193323Sed --more-help Pass the extended usage text through a pager 125193323Sed 126193323SedOptions are specified by doubled hyphens and their name or by a single 127193323Sedhyphen and the flag character. 128193323Sed</pre> 129193323Sed <div class="node"> 130193323Sed<p><hr> 131193323Sed<a name="ntp_002dwait-tries"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-sleep">ntp-wait sleep</a>, 132193323SedPrevious: <a rel="previous" accesskey="p" href="#ntp_002dwait-usage">ntp-wait usage</a>, 133193323SedUp: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 134234353Sdim<br> 135193323Sed</div> 136193323Sed 137193323Sed<h4 class="subsection">0.1.2 tries option (-n)</h4> 138193323Sed 139193323Sed<p><a name="index-ntp_002dwait_002dtries-4"></a> 140234353SdimThis is the “number of times to check ntpd” option. 141193323SedThis option takes a number argument. 142193323Sed The maximum number of times we will check <code>ntpd</code> to see if 143193323Sed it has been able to synchronize and stabilize the system clock. 144193323Sed<div class="node"> 145193323Sed<p><hr> 146193323Sed<a name="ntp_002dwait-sleep"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-verbose">ntp-wait verbose</a>, 147193323SedPrevious: <a rel="previous" accesskey="p" href="#ntp_002dwait-tries">ntp-wait tries</a>, 148193323SedUp: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 149193323Sed<br> 150193323Sed</div> 151234353Sdim 152193323Sed<h4 class="subsection">0.1.3 sleep option (-s)</h4> 153193323Sed 154193323Sed<p><a name="index-ntp_002dwait_002dsleep-5"></a> 155193323SedThis is the “how long to sleep between tries” option. 156193323SedThis option takes a number argument <span class="file">secs-between-tries</span>. 157193323Sed We will sleep for <span class="file">secs-between-tries</span> after each query 158193323Sed of <code>ntpd</code> that returns "the time is not yet stable". 159193323Sed<div class="node"> 160199989Srdivacky<p><hr> 161199989Srdivacky<a name="ntp_002dwait-verbose"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>, 162199989SrdivackyPrevious: <a rel="previous" accesskey="p" href="#ntp_002dwait-sleep">ntp-wait sleep</a>, 163193323SedUp: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 164193323Sed<br> 165193323Sed</div> 166193323Sed 167<h4 class="subsection">0.1.4 verbose option (-v)</h4> 168 169<p><a name="index-ntp_002dwait_002dverbose-6"></a> 170This is the “be verbose” option. 171 By default, <code>ntp-wait</code> is silent. 172 With this option, <code>ntp-wait</code> will provide status information. 173<div class="node"> 174<p><hr> 175<a name="ntp_002dwait-exit-status"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-Authors">ntp-wait Authors</a>, 176Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait-verbose">ntp-wait verbose</a>, 177Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 178<br> 179</div> 180 181<h4 class="subsection">0.1.5 ntp-wait exit status</h4> 182 183<p>One of the following exit values will be returned: 184 <dl> 185<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 186<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 187</dl> 188 <div class="node"> 189<p><hr> 190<a name="ntp_002dwait-Authors"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dwait-Notes">ntp-wait Notes</a>, 191Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>, 192Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 193<br> 194</div> 195 196<h4 class="subsection">0.1.6 ntp-wait Authors</h4> 197 198<div class="node"> 199<p><hr> 200<a name="ntp_002dwait-Notes"></a>Previous: <a rel="previous" accesskey="p" href="#ntp_002dwait-Authors">ntp-wait Authors</a>, 201Up: <a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a> 202<br> 203</div> 204 205<h4 class="subsection">0.1.7 ntp-wait Notes</h4> 206 207</body></html> 208 209