Home | History | Annotate | Line # | Download | only in sntp
sntp.html revision 1.1.1.3
      1 <html lang="en">
      2 <head>
      3 <title>Sntp User's Manual</title>
      4 <meta http-equiv="Content-Type" content="text/html">
      5 <meta name="description" content="Sntp User's Manual">
      6 <meta name="generator" content="makeinfo 4.7">
      7 <link title="Top" rel="top" href="#Top">
      8 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
      9 <meta http-equiv="Content-Style-Type" content="text/css">
     10 <style type="text/css"><!--
     11   pre.display { font-family:inherit }
     12   pre.format  { font-family:inherit }
     13   pre.smalldisplay { font-family:inherit; font-size:smaller }
     14   pre.smallformat  { font-family:inherit; font-size:smaller }
     15   pre.smallexample { font-size:smaller }
     16   pre.smalllisp    { font-size:smaller }
     17   span.sc { font-variant:small-caps }
     18   span.roman { font-family: serif; font-weight: normal; } 
     19 --></style>
     20 </head>
     21 <body>
     22 <h1 class="settitle">Sntp User's Manual</h1>
     23 <div class="node">
     24 <p><hr>
     25 <a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Description">sntp Description</a>,
     26 Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
     27 Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
     28 <br>
     29 </div>
     30 
     31 <h2 class="unnumbered">Simple Network Time Protocol User Manual</h2>
     32 
     33 <p>This document describes the use of the NTP Project's <code>sntp</code> program,
     34 that can be used to query a Network Time Protocol (NTP) server and
     35 display the time offset of the system clock relative to the server
     36 clock.  Run as root, it can correct the system clock to this offset as
     37 well.  It can be run as an interactive command or from a cron job.
     38 
     39   <p>This document applies to version 4.2.7p404 of <code>sntp</code>.
     40 
     41   <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
     42 IETF specification.
     43 
     44   <div class="shortcontents">
     45 <h2>Short Contents</h2>
     46 <ul>
     47 <a href="#Top">Simple Network Time Protocol User Manual</a>
     48 </ul>
     49 </div>
     50 
     51 <ul class="menu">
     52 <li><a accesskey="1" href="#sntp-Description">sntp Description</a>:             Description
     53 <li><a accesskey="2" href="#sntp-Invocation">sntp Invocation</a>: 		Invoking sntp
     54 <li><a accesskey="3" href="#Usage">Usage</a>:                        Usage
     55 </ul>
     56 
     57 <div class="node">
     58 <p><hr>
     59 <a name="sntp-Description"></a>
     60 <br>
     61 </div>
     62 
     63 <!-- node-name,  next,  previous,  up -->
     64 <h3 class="section">Description</h3>
     65 
     66 <p>By default, <code>sntp</code> writes the local data and time (i.e., not UTC) to the
     67 standard output in the format:
     68 
     69 <pre class="example">     1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
     70 </pre>
     71   <p>where
     72 YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
     73 (+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
     74 and
     75 the +4.567 +/- 0.089 secs indicates the time offset and
     76 error bound of the system clock relative to the server clock.
     77 
     78 <div class="node">
     79 <p><hr>
     80 <a name="sntp-Invocation"></a>
     81 <br>
     82 </div>
     83 
     84 <h3 class="section">Invoking sntp</h3>
     85 
     86 <p><a name="index-sntp-1"></a><a name="index-standard-Simple-Network-Time-Protocol-client-program-2"></a>
     87 
     88   <p><code>sntp</code>
     89 can be used as an SNTP client to query a NTP or SNTP server and either display
     90 the time or set the local system's time (given suitable privilege).  It can be
     91 run as an interactive command or from a
     92 <code>cron</code>
     93 job.
     94 
     95   <p>NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
     96 are defined and described by RFC 5905.
     97 
     98   <p>The default is to write the estimated correct local date and time (i.e. not
     99 UTC) to the standard output in a format like:
    100 
    101   <p><code>'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'</code>
    102 
    103   <p>where the
    104 <code>'(+0800)'</code>
    105 means that to get to UTC from the reported local time one must
    106 add 8 hours and 0 minutes,
    107 the
    108 <code>'+4.567'</code>
    109 indicates the local clock is 4.567 seconds behind the correct time
    110 (so 4.567 seconds must be added to the local clock to get it to be correct). 
    111 Note that the number of decimals printed for this value will change
    112 based on the reported precision of the server. 
    113 <code>'+/- 0.089'</code>
    114 is the reported
    115 <em>synchronization</em> <em>distance</em>
    116 (in seconds), which represents the maximum error due to all causes. 
    117 If the server does not report valid data needed to calculate the
    118 synchronization distance, this will be reported as
    119 <code>'+/- ?'</code>. 
    120 If the
    121 <em>host</em>
    122 is different from the
    123 <em>IP</em>,
    124 both will be displayed. 
    125 Otherwise, only the
    126 <em>IP</em>
    127 is displayed. 
    128 Finally, the
    129 <em>stratum</em>
    130 of the host is reported.
    131 
    132   <p>This section was generated by <strong>AutoGen</strong>,
    133 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>sntp</code> program. 
    134 This software is released under the NTP license, &lt;http://ntp.org/license>;.
    135 
    136 <ul class="menu">
    137 <li><a accesskey="1" href="#sntp-usage">sntp usage</a>:                   sntp help/usage (<span class="option">--help</span>)
    138 <li><a accesskey="2" href="#sntp-ipv4">sntp ipv4</a>:                    ipv4 option (-4)
    139 <li><a accesskey="3" href="#sntp-ipv6">sntp ipv6</a>:                    ipv6 option (-6)
    140 <li><a accesskey="4" href="#sntp-authentication">sntp authentication</a>:          authentication option (-a)
    141 <li><a accesskey="5" href="#sntp-broadcast">sntp broadcast</a>:               broadcast option (-b)
    142 <li><a accesskey="6" href="#sntp-concurrent">sntp concurrent</a>:              concurrent option (-c)
    143 <li><a accesskey="7" href="#sntp-gap">sntp gap</a>:                     gap option (-g)
    144 <li><a accesskey="8" href="#sntp-kod">sntp kod</a>:                     kod option (-K)
    145 <li><a accesskey="9" href="#sntp-keyfile">sntp keyfile</a>:                 keyfile option (-k)
    146 <li><a href="#sntp-logfile">sntp logfile</a>:                 logfile option (-l)
    147 <li><a href="#sntp-steplimit">sntp steplimit</a>:               steplimit option (-M)
    148 <li><a href="#sntp-ntpversion">sntp ntpversion</a>:              ntpversion option (-o)
    149 <li><a href="#sntp-usereservedport">sntp usereservedport</a>:         usereservedport option (-r)
    150 <li><a href="#sntp-timeout">sntp timeout</a>:                 timeout option (-t)
    151 <li><a href="#sntp-wait">sntp wait</a>:                    wait option
    152 <li><a href="#sntp-config">sntp config</a>:                  presetting/configuring sntp
    153 <li><a href="#sntp-exit-status">sntp exit status</a>:             exit status
    154 <li><a href="#sntp-Usage">sntp Usage</a>:                   Usage
    155 <li><a href="#sntp-Authors">sntp Authors</a>:                 Authors
    156 <li><a href="#sntp-Notes">sntp Notes</a>:                   Notes
    157 </ul>
    158 
    159 <div class="node">
    160 <p><hr>
    161 <a name="sntp-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv4">sntp ipv4</a>,
    162 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    163 <br>
    164 </div>
    165 
    166 <h4 class="subsection">sntp help/usage (<span class="option">--help</span>)</h4>
    167 
    168 <p><a name="index-sntp-help-3"></a>
    169 This is the automatically generated usage text for sntp.
    170 
    171   <p>The text printed is the same whether selected with the <code>help</code> option
    172 (<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
    173 the usage text by passing it through a pager program. 
    174 <code>more-help</code> is disabled on platforms without a working
    175 <code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
    176 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
    177 with a status code of 0.
    178 
    179 <pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p404
    180 Usage:  sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
    181                 [ hostname-or-IP ...]
    182   Flg Arg Option-Name    Description
    183    -4 no  ipv4           Force IPv4 DNS name resolution
    184                                 - prohibits the option 'ipv6'
    185    -6 no  ipv6           Force IPv6 DNS name resolution
    186                                 - prohibits the option 'ipv4'
    187    -a Num authentication Enable authentication with the key auth-keynumber
    188    -b Str broadcast      Listen to the address specified for broadcast time sync
    189                                 - may appear multiple times
    190    -c Str concurrent     Concurrently query all IPs returned for host-name
    191                                 - may appear multiple times
    192    -d no  debug-level    Increase debug verbosity level
    193                                 - may appear multiple times
    194    -D Num set-debug-level Set the debug verbosity level
    195                                 - may appear multiple times
    196    -g Num gap            The gap (in milliseconds) between time requests
    197    -K Fil kod            KoD history filename
    198    -k Fil keyfile        Look in this file for the key specified with -a
    199    -l Fil logfile        Log to specified logfile
    200    -M Num steplimit      Adjustments less than steplimit msec will be slewed
    201                                 - it must be in the range:
    202                                   greater than or equal to 0
    203    -o Num ntpversion     Send int as our NTP protocol version
    204                                 - it must be in the range:
    205                                   0 to 7
    206    -r no  usereservedport Use the NTP Reserved Port (port 123)
    207    -S no  step           OK to 'step' the time with settimeofday(2)
    208    -s no  slew           OK to 'slew' the time with adjtime(2)
    209    -t Num timeout        The number of seconds to wait for responses
    210       no  wait           Wait for pending replies (if not setting the time)
    211                                 - disabled as '--no-wait'
    212                                 - enabled by default
    213       opt version        output version information and exit
    214    -? no  help           display extended usage information and exit
    215    -! no  more-help      extended usage information passed thru pager
    216    -&gt; opt save-opts      save the option state to a config file
    217    -&lt; Str load-opts      load options from a config file
    218                                 - disabled as '--no-load-opts'
    219                                 - may appear multiple times
    220 
    221 Options are specified by doubled hyphens and their name or by a single
    222 hyphen and the flag character.
    223 
    224 
    225 The following option preset mechanisms are supported:
    226  - reading file $HOME/.ntprc
    227  - reading file ./.ntprc
    228  - examining environment variables named SNTP_*
    229 
    230 Please send bug reports to:  &lt;http://bugs.ntp.org, bugs (a] ntp.org&gt;
    231 
    232 exit 0
    233 </pre>
    234   <div class="node">
    235 <p><hr>
    236 <a name="sntp-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv6">sntp ipv6</a>,
    237 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-usage">sntp usage</a>,
    238 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    239 <br>
    240 </div>
    241 
    242 <h4 class="subsection">ipv4 option (-4)</h4>
    243 
    244 <p><a name="index-sntp_002dipv4-4"></a>
    245 This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
    246 
    247 <p class="noindent">This option has some usage constraints.  It:
    248      <ul>
    249 <li>must not appear in combination with any of the following options:
    250 ipv6. 
    251 </ul>
    252 
    253   <p>Force DNS resolution of the following host names on the command line
    254 to the IPv4 namespace. 
    255 <div class="node">
    256 <p><hr>
    257 <a name="sntp-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-authentication">sntp authentication</a>,
    258 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ipv4">sntp ipv4</a>,
    259 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    260 <br>
    261 </div>
    262 
    263 <h4 class="subsection">ipv6 option (-6)</h4>
    264 
    265 <p><a name="index-sntp_002dipv6-5"></a>
    266 This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
    267 
    268 <p class="noindent">This option has some usage constraints.  It:
    269      <ul>
    270 <li>must not appear in combination with any of the following options:
    271 ipv4. 
    272 </ul>
    273 
    274   <p>Force DNS resolution of the following host names on the command line
    275 to the IPv6 namespace. 
    276 <div class="node">
    277 <p><hr>
    278 <a name="sntp-authentication"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-broadcast">sntp broadcast</a>,
    279 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ipv6">sntp ipv6</a>,
    280 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    281 <br>
    282 </div>
    283 
    284 <h4 class="subsection">authentication option (-a)</h4>
    285 
    286 <p><a name="index-sntp_002dauthentication-6"></a>
    287 This is the &ldquo;enable authentication with the key <var>auth-keynumber</var>&rdquo; option. 
    288 This option takes a number argument <span class="file">auth-keynumber</span>. 
    289 Enable authentication using the key specified in this option's
    290 argument.  The argument of this option is the <span class="option">keyid</span>, a
    291 number specified in the <span class="option">keyfile</span> as this key's identifier. 
    292 See the <span class="option">keyfile</span> option (<span class="option">-k</span>) for more details. 
    293 <div class="node">
    294 <p><hr>
    295 <a name="sntp-broadcast"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-concurrent">sntp concurrent</a>,
    296 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-authentication">sntp authentication</a>,
    297 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    298 <br>
    299 </div>
    300 
    301 <h4 class="subsection">broadcast option (-b)</h4>
    302 
    303 <p><a name="index-sntp_002dbroadcast-7"></a>
    304 This is the &ldquo;listen to the address specified for broadcast time sync&rdquo; option. 
    305 This option takes a string argument <span class="file">broadcast-address</span>.
    306 
    307 <p class="noindent">This option has some usage constraints.  It:
    308      <ul>
    309 <li>may appear an unlimited number of times. 
    310 </ul>
    311 
    312   <p>If specified <code>sntp</code> will listen to the specified address
    313 for NTP broadcasts.  The default maximum wait time
    314 can (and probably should) be modified with <span class="option">-t</span>. 
    315 <div class="node">
    316 <p><hr>
    317 <a name="sntp-concurrent"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-gap">sntp gap</a>,
    318 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-broadcast">sntp broadcast</a>,
    319 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    320 <br>
    321 </div>
    322 
    323 <h4 class="subsection">concurrent option (-c)</h4>
    324 
    325 <p><a name="index-sntp_002dconcurrent-8"></a>
    326 This is the &ldquo;concurrently query all ips returned for host-name&rdquo; option. 
    327 This option takes a string argument <span class="file">host-name</span>.
    328 
    329 <p class="noindent">This option has some usage constraints.  It:
    330      <ul>
    331 <li>may appear an unlimited number of times. 
    332 </ul>
    333 
    334   <p>Requests from an NTP "client" to a "server" should never be sent
    335 more rapidly than one every 2 seconds.  By default, any IPs returned
    336 as part of a DNS lookup are assumed to be for a single instance of
    337 <code>ntpd</code>, and therefore <code>sntp</code> will send queries to these IPs
    338 one after another, with a 2-second gap in between each query.
    339 
    340   <p>The <span class="option">-c</span> or <span class="option">--concurrent</span> flag says that any IPs
    341 returned for the DNS lookup of the supplied host-name are on
    342 different machines, so we can send concurrent queries. 
    343 <div class="node">
    344 <p><hr>
    345 <a name="sntp-gap"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-kod">sntp kod</a>,
    346 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-concurrent">sntp concurrent</a>,
    347 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    348 <br>
    349 </div>
    350 
    351 <h4 class="subsection">gap option (-g)</h4>
    352 
    353 <p><a name="index-sntp_002dgap-9"></a>
    354 This is the &ldquo;the gap (in milliseconds) between time requests&rdquo; option. 
    355 This option takes a number argument <span class="file">milliseconds</span>. 
    356 Since we're only going to use the first valid response we get and
    357 there is benefit to specifying a good number of servers to query,
    358 separate the queries we send out by the specified number of
    359 milliseconds. 
    360 <div class="node">
    361 <p><hr>
    362 <a name="sntp-kod"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-keyfile">sntp keyfile</a>,
    363 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-gap">sntp gap</a>,
    364 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    365 <br>
    366 </div>
    367 
    368 <h4 class="subsection">kod option (-K)</h4>
    369 
    370 <p><a name="index-sntp_002dkod-10"></a>
    371 This is the &ldquo;kod history filename&rdquo; option. 
    372 This option takes a file argument <span class="file">file-name</span>. 
    373 Specifies the filename to be used for the persistent history of KoD
    374 responses received from servers. 
    375 <div class="node">
    376 <p><hr>
    377 <a name="sntp-keyfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-logfile">sntp logfile</a>,
    378 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-kod">sntp kod</a>,
    379 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    380 <br>
    381 </div>
    382 
    383 <h4 class="subsection">keyfile option (-k)</h4>
    384 
    385 <p><a name="index-sntp_002dkeyfile-11"></a>
    386 This is the &ldquo;look in this file for the key specified with <span class="option">-a</span>&rdquo; option. 
    387 This option takes a file argument <span class="file">file-name</span>. 
    388 This option specifies the keyfile. 
    389 <code>sntp</code> will search for the key specified with <span class="option">-a</span>
    390 <span class="file">keyno</span> in this file.  See <span class="command">ntp.keys(5)</span> for more
    391 information. 
    392 <div class="node">
    393 <p><hr>
    394 <a name="sntp-logfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-steplimit">sntp steplimit</a>,
    395 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-keyfile">sntp keyfile</a>,
    396 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    397 <br>
    398 </div>
    399 
    400 <h4 class="subsection">logfile option (-l)</h4>
    401 
    402 <p><a name="index-sntp_002dlogfile-12"></a>
    403 This is the &ldquo;log to specified logfile&rdquo; option. 
    404 This option takes a file argument <span class="file">file-name</span>. 
    405 This option causes the client to write log messages to the specified
    406 <span class="file">logfile</span>. 
    407 <div class="node">
    408 <p><hr>
    409 <a name="sntp-steplimit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ntpversion">sntp ntpversion</a>,
    410 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-logfile">sntp logfile</a>,
    411 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    412 <br>
    413 </div>
    414 
    415 <h4 class="subsection">steplimit option (-M)</h4>
    416 
    417 <p><a name="index-sntp_002dsteplimit-13"></a>
    418 This is the &ldquo;adjustments less than <var>steplimit</var> msec will be slewed&rdquo; option. 
    419 This option takes a number argument. 
    420 If the time adjustment is less than <span class="file">steplimit</span> milliseconds,
    421 slew the amount using <span class="command">adjtime(2)</span>.  Otherwise, step the
    422 correction using <span class="command">settimeofday(2)</span>. 
    423 <div class="node">
    424 <p><hr>
    425 <a name="sntp-ntpversion"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-usereservedport">sntp usereservedport</a>,
    426 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-steplimit">sntp steplimit</a>,
    427 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    428 <br>
    429 </div>
    430 
    431 <h4 class="subsection">ntpversion option (-o)</h4>
    432 
    433 <p><a name="index-sntp_002dntpversion-14"></a>
    434 This is the &ldquo;send <var>int</var> as our ntp protocol version&rdquo; option. 
    435 This option takes a number argument. 
    436 When sending requests to a remote server, tell them we are running
    437 NTP protocol version <span class="file">ntpversion</span> . 
    438 <div class="node">
    439 <p><hr>
    440 <a name="sntp-usereservedport"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-timeout">sntp timeout</a>,
    441 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ntpversion">sntp ntpversion</a>,
    442 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    443 <br>
    444 </div>
    445 
    446 <h4 class="subsection">usereservedport option (-r)</h4>
    447 
    448 <p><a name="index-sntp_002dusereservedport-15"></a>
    449 This is the &ldquo;use the ntp reserved port (port 123)&rdquo; option. 
    450 Use port 123, which is reserved for NTP, for our network
    451 communications. 
    452 <div class="node">
    453 <p><hr>
    454 <a name="sntp-timeout"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-wait">sntp wait</a>,
    455 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-usereservedport">sntp usereservedport</a>,
    456 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    457 <br>
    458 </div>
    459 
    460 <h4 class="subsection">timeout option (-t)</h4>
    461 
    462 <p><a name="index-sntp_002dtimeout-16"></a>
    463 This is the &ldquo;the number of seconds to wait for responses&rdquo; option. 
    464 This option takes a number argument <span class="file">seconds</span>. 
    465 When waiting for a reply, <code>sntp</code> will wait the number
    466 of seconds specified before giving up.  The default should be
    467 more than enough for a unicast response.  If <code>sntp</code> is
    468 only waiting for a broadcast response a longer timeout is
    469 likely needed. 
    470 <div class="node">
    471 <p><hr>
    472 <a name="sntp-wait"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-config">sntp config</a>,
    473 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-timeout">sntp timeout</a>,
    474 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    475 <br>
    476 </div>
    477 
    478 <h4 class="subsection">wait option</h4>
    479 
    480 <p><a name="index-sntp_002dwait-17"></a>
    481 This is the &ldquo;wait for pending replies (if not setting the time)&rdquo; option.
    482 
    483 <p class="noindent">This option has some usage constraints.  It:
    484      <ul>
    485 <li>can be disabled with &ndash;no-wait. 
    486 <li>It is enabled by default. 
    487 </ul>
    488 
    489   <p>If we are not setting the time, wait for all pending responses.
    490 
    491 <div class="node">
    492 <p><hr>
    493 <a name="sntp-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-exit-status">sntp exit status</a>,
    494 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-wait">sntp wait</a>,
    495 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    496 <br>
    497 </div>
    498 
    499 <h4 class="subsection">presetting/configuring sntp</h4>
    500 
    501 <p>Any option that is not marked as <i>not presettable</i> may be preset by
    502 loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>SNTP</code> and <code>SNTP_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
    503 the options listed above in upper case and segmented with underscores. 
    504 The <code>SNTP</code> variable will be tokenized and parsed like
    505 the command line.  The remaining variables are tested for existence and their
    506 values are treated like option arguments.
    507 
    508 <p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
    509      <ul>
    510 <li>$HOME
    511 <li>$PWD
    512 </ul>
    513   The environment variables <code>HOME</code>, and <code>PWD</code>
    514 are expanded and replaced when <span class="file">sntp</span> runs. 
    515 For any of these that are plain files, they are simply processed. 
    516 For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
    517 within that directory and processed.
    518 
    519   <p>Configuration files may be in a wide variety of formats. 
    520 The basic format is an option name followed by a value (argument) on the
    521 same line.  Values may be separated from the option name with a colon,
    522 equal sign or simply white space.  Values may be continued across multiple
    523 lines by escaping the newline with a backslash.
    524 
    525   <p>Multiple programs may also share the same initialization file. 
    526 Common options are collected at the top, followed by program specific
    527 segments.  The segments are separated by lines like:
    528 <pre class="example">    [SNTP]
    529 </pre>
    530   <p class="noindent">or by
    531 <pre class="example">    &lt;?program sntp&gt;
    532 </pre>
    533   <p class="noindent">Do not mix these styles within one configuration file.
    534 
    535   <p>Compound values and carefully constructed string values may also be
    536 specified using XML syntax:
    537 <pre class="example">    &lt;option-name&gt;
    538        &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
    539     &lt;/option-name&gt;
    540 </pre>
    541   <p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
    542 <pre class="example">    "...&lt;...&gt;..."
    543 </pre>
    544   <p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
    545 hierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
    546 the associated name/value pair list (see: optionFindValue).
    547 
    548   <p>The command line options relating to configuration and/or usage help are:
    549 
    550 <h5 class="subsubheading">version (-)</h5>
    551 
    552 <p>Print the program version to standard out, optionally with licensing
    553 information, then exit 0.  The optional argument specifies how much licensing
    554 detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument. 
    555 Only the first letter of the argument is examined:
    556 
    557      <dl>
    558 <dt><span class="samp">version</span><dd>Only print the version.  This is the default. 
    559 <br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms. 
    560 <br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms. 
    561 </dl>
    562 
    563 <div class="node">
    564 <p><hr>
    565 <a name="sntp-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Usage">sntp Usage</a>,
    566 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-config">sntp config</a>,
    567 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    568 <br>
    569 </div>
    570 
    571 <h4 class="subsection">sntp exit status</h4>
    572 
    573 <p>One of the following exit values will be returned:
    574      <dl>
    575 <dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 
    576 <br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 
    577 <br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded. 
    578 <br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error.  Please report
    579 it to autogen-users (a] lists.sourceforge.net.  Thank you. 
    580 </dl>
    581   <div class="node">
    582 <p><hr>
    583 <a name="sntp-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Authors">sntp Authors</a>,
    584 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-exit-status">sntp exit status</a>,
    585 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    586 <br>
    587 </div>
    588 
    589 <h4 class="subsection">sntp Usage</h4>
    590 
    591 <div class="node">
    592 <p><hr>
    593 <a name="sntp-Authors"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Notes">sntp Notes</a>,
    594 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-Usage">sntp Usage</a>,
    595 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    596 <br>
    597 </div>
    598 
    599 <h4 class="subsection">sntp Authors</h4>
    600 
    601 <div class="node">
    602 <p><hr>
    603 <a name="sntp-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-Authors">sntp Authors</a>,
    604 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
    605 <br>
    606 </div>
    607 
    608 <h4 class="subsection">sntp Notes</h4>
    609 
    610 <div class="node">
    611 <p><hr>
    612 <a name="Usage"></a>
    613 <br>
    614 </div>
    615 
    616 <!-- node-name,  next,  previous,  up -->
    617 <h3 class="section">Usage</h3>
    618 
    619 <p>The simplest use of this program is as an unprivileged command to
    620 check the current time, offset, and error in the local clock. 
    621 For example:
    622 
    623 <pre class="example">    sntp ntpserver.somewhere
    624 </pre>
    625   <p>With suitable privilege, it can be run as a command or in a
    626 <code>crom</code> job to reset the local clock from a reliable server, like
    627 the <code>ntpdate</code> and <code>rdate</code> commands. 
    628 For example:
    629 
    630 <pre class="example">    sntp -a ntpserver.somewhere
    631 </pre>
    632   </body></html>
    633 
    634