1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Ntp-wait User’s Manual</title>
8 <meta name="description" content="Ntp-wait User’s Manual">
9 <meta name="keywords" content="Ntp-wait User’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">
17 a.summary-letter {text-decoration: none}
18 blockquote.indentedblock {margin-right: 0em}
19 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20 blockquote.smallquotation {font-size: smaller}
21 div.display {margin-left: 3.2em}
22 div.example {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 div.smalldisplay {margin-left: 3.2em}
25 div.smallexample {margin-left: 3.2em}
26 div.smalllisp {margin-left: 3.2em}
27 kbd {font-style: oblique}
28 pre.display {font-family: inherit}
29 pre.format {font-family: inherit}
30 pre.menu-comment {font-family: serif}
31 pre.menu-preformatted {font-family: serif}
32 pre.smalldisplay {font-family: inherit; font-size: smaller}
33 pre.smallexample {font-size: smaller}
34 pre.smallformat {font-family: inherit; font-size: smaller}
35 pre.smalllisp {font-size: smaller}
36 span.nolinebreak {white-space: nowrap}
37 span.roman {font-family: initial; font-weight: normal}
38 span.sansserif {font-family: sans-serif; font-weight: normal}
39 ul.no-bullet {list-style: none}
47 <h1 class="settitle" align="center">Ntp-wait User’s Manual</h1>
56 Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> </p>
58 <h1 class="node-heading">Top</h1>
60 <p>This document describes the use of the NTP Project’s <code>ntp-wait</code> program.
62 <p>If there are time-sensitive applications,
63 the proper sequence of events is to
64 run <code>ntpd -g</code> as early as possible,
65 then invoke all of the non-time-sensitive process,
66 run <code>ntp-wait</code> to block
67 until the system’s time has stabilized and synchronized,
68 and only then start any applicaitons (like database servers) that require
69 accurate and stable time.
71 <p>This document applies to version 4.2.8p14 of <code>ntp-wait</code>.
73 <a name="SEC_Overview"></a>
74 <h2 class="shortcontents-heading">Short Table of Contents</h2>
76 <div class="shortcontents">
77 <li><a name="stoc-Invoking-ntp_002dwait" href="#toc-Invoking-ntp_002dwait">1 Invoking ntp-wait</a></li>
82 <table class="menu" border="0" cellspacing="0">
83 <tr><td align="left" valign="top">• ntp-wait Description:</td><td> </td><td align="left" valign="top">Description
85 <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
90 <a name="ntp_002dwait-Invocation"></a>
93 Up: <a href="#Top" accesskey="u" rel="up">Top</a> </p>
95 <a name="Invoking-ntp_002dwait"></a>
96 <h3 class="section">1 Invoking ntp-wait</h3>
97 <a name="index-ntp_002dwait"></a>
98 <a name="index-Wait-for-ntpd-to-stabilize-the-system-clock"></a>
102 <p><code>ntp-wait</code>
106 <code>ntpd(8)</code>,
108 <kbd>secs-between-tries</kbd>
109 after each status return that says
111 has not yet produced a synchronized and stable system clock.
113 <p><code>ntp-wait</code>
114 will do this quietly, unless the
117 This can be useful at boot time, to delay the boot sequence until after
118 <kbd>ntpd</kbd> <kbd>-g</kbd>
121 <p>This section was generated by <strong>AutoGen</strong>,
122 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
124 <table class="menu" border="0" cellspacing="0">
125 <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>)
127 <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)
129 <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)
131 <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)
133 <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
135 <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
137 <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
142 <a name="ntp_002dwait-usage"></a>
145 Next: <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>
147 <a name="ntp_002dwait-help_002fusage-_0028_002d_002dhelp_0029"></a>
148 <h4 class="subsection">1.1 ntp-wait help/usage (<samp>--help</samp>)</h4>
149 <a name="index-ntp_002dwait-help"></a>
151 <p>This is the automatically generated usage text for ntp-wait.
153 <p>The text printed is the same whether selected with the <code>help</code> option
154 (<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>). <code>more-help</code> will print
155 the usage text by passing it through a pager program.
156 <code>more-help</code> is disabled on platforms without a working
157 <code>fork(2)</code> function. The <code>PAGER</code> environment variable is
158 used to select the program, defaulting to <samp>more</samp>. Both will exit
159 with a status code of 0.
161 <div class="example">
162 <pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p14
163 USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
165 -n, --tries=num Number of times to check ntpd
166 -s, --sleep=num How long to sleep between tries
167 -v, --verbose Be verbose
168 -?, --help Display usage information and exit
169 --more-help Pass the extended usage text through a pager
171 Options are specified by doubled hyphens and their name or by a single
172 hyphen and the flag character.
176 <a name="ntp_002dwait-tries"></a>
179 Next: <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>
181 <a name="tries-option-_0028_002dn_0029"></a>
182 <h4 class="subsection">1.2 tries option (-n)</h4>
183 <a name="index-ntp_002dwait_002dtries"></a>
185 <p>This is the “number of times to check ntpd” option.
186 This option takes a number argument.
187 The maximum number of times we will check <code>ntpd</code> to see if
188 it has been able to synchronize and stabilize the system clock.
190 <a name="ntp_002dwait-sleep"></a>
193 Next: <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>
195 <a name="sleep-option-_0028_002ds_0029"></a>
196 <h4 class="subsection">1.3 sleep option (-s)</h4>
197 <a name="index-ntp_002dwait_002dsleep"></a>
199 <p>This is the “how long to sleep between tries” option.
200 This option takes a number argument <samp>secs-between-tries</samp>.
201 We will sleep for <samp>secs-between-tries</samp> after each query
202 of <code>ntpd</code> that returns "the time is not yet stable".
204 <a name="ntp_002dwait-verbose"></a>
207 Next: <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>
209 <a name="verbose-option-_0028_002dv_0029"></a>
210 <h4 class="subsection">1.4 verbose option (-v)</h4>
211 <a name="index-ntp_002dwait_002dverbose"></a>
213 <p>This is the “be verbose” option.
214 By default, <code>ntp-wait</code> is silent.
215 With this option, <code>ntp-wait</code> will provide status information.
217 <a name="ntp_002dwait-exit-status"></a>
220 Next: <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>
222 <a name="ntp_002dwait-exit-status-1"></a>
223 <h4 class="subsection">1.5 ntp-wait exit status</h4>
225 <p>One of the following exit values will be returned:
226 </p><dl compact="compact">
227 <dt>‘<samp>0 (EXIT_SUCCESS)</samp>’</dt>
228 <dd><p>Successful program execution.
230 <dt>‘<samp>1 (EXIT_FAILURE)</samp>’</dt>
231 <dd><p>The operation failed or the command syntax was not valid.
235 <a name="ntp_002dwait-Authors"></a>
238 Next: <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>
240 <a name="ntp_002dwait-Authors-1"></a>
241 <h4 class="subsection">1.6 ntp-wait Authors</h4>
243 <a name="ntp_002dwait-Notes"></a>
246 Previous: <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>
248 <a name="ntp_002dwait-Notes-1"></a>
249 <h4 class="subsection">1.7 ntp-wait Notes</h4>