Home | History | Annotate | Line # | Download | only in ntpdc
      1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2 <html>
      3 <!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
      4 <head>
      5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      6 <title>ntpdc: NTPD Control User&rsquo;s Manual</title>
      7 
      8 <meta name="description" content="ntpdc: NTPD Control User&rsquo;s Manual">
      9 <meta name="keywords" content="ntpdc: NTPD Control User&rsquo;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">
     16 <!--
     17 a.summary-letter {text-decoration: none}
     18 blockquote.indentedblock {margin-right: 0em}
     19 div.display {margin-left: 3.2em}
     20 div.example {margin-left: 3.2em}
     21 div.lisp {margin-left: 3.2em}
     22 kbd {font-style: oblique}
     23 pre.display {font-family: inherit}
     24 pre.format {font-family: inherit}
     25 pre.menu-comment {font-family: serif}
     26 pre.menu-preformatted {font-family: serif}
     27 span.nolinebreak {white-space: nowrap}
     28 span.roman {font-family: initial; font-weight: normal}
     29 span.sansserif {font-family: sans-serif; font-weight: normal}
     30 ul.no-bullet {list-style: none}
     31 -->
     32 </style>
     33 
     34 
     35 </head>
     36 
     37 <body lang="en">
     38 <h1 class="settitle" align="center">ntpdc: NTPD Control User&rsquo;s Manual</h1>
     39 
     40 
     41 
     42 
     43 
     44 <span id="Top"></span><div class="header">
     45 <p>
     46 Next: <a href="#ntpdc-Description" accesskey="n" rel="next">ntpdc Description</a>, Previous: <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>
     47 </div>
     48 <span id="ntpdc_003a-NTPD-Control-User-Manual"></span><h1 class="top">ntpdc: NTPD Control User Manual</h1>
     49 
     50 <p>This document describes the use of the NTP Project&rsquo;s <code>ntpdc</code> program,
     51 that can be used to query a Network Time Protocol (NTP) server and
     52 display the time offset of the system clock relative to the server
     53 clock.  Run as root, it can correct the system clock to this offset as
     54 well.  It can be run as an interactive command or from a cron job.
     55 </p>
     56 <p>This document applies to version 4.2.8p18 of <code>ntpdc</code>.
     57 </p>
     58 <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
     59 IETF specification.
     60 </p>
     61 <span id="SEC_Overview"></span>
     62 <h2 class="shortcontents-heading">Short Table of Contents</h2>
     63 
     64 <div class="shortcontents">
     65 <ul class="no-bullet">
     66 <li><a id="stoc-Description" href="#toc-Description">1 Description</a></li>
     67 </ul>
     68 </div>
     69 
     70 
     71 <table class="menu" border="0" cellspacing="0">
     72 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-Description" accesskey="1">ntpdc Description</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
     73 </td></tr>
     74 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-Invocation" accesskey="2">ntpdc Invocation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking ntpdc
     75 </td></tr>
     76 <tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="3">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Usage
     77 </td></tr>
     78 </table>
     79 
     80 <hr>
     81 <span id="ntpdc-Description"></span><div class="header">
     82 <p>
     83 Next: <a href="#ntpdc-Invocation" accesskey="n" rel="next">ntpdc Invocation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
     84 </div>
     85 <span id="Description"></span><h2 class="chapter">1 Description</h2>
     86 
     87 <p>By default, <code>ntpdc</code> writes the local data and time (i.e., not UTC) to the
     88 standard output in the format:
     89 </p>
     90 <div class="example">
     91 <pre class="example">1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
     92 </pre></div>
     93 
     94 <p>where
     95 YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
     96 (+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
     97 and
     98 the +4.567 +/- 0.089 secs indicates the time offset and
     99 error bound of the system clock relative to the server clock.
    100 </p>
    101 <table class="menu" border="0" cellspacing="0">
    102 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-Invocation" accesskey="1">Invoking ntpdc</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    103 </td></tr>
    104 <tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    105 </td></tr>
    106 </table>
    107 
    108 <hr>
    109 <span id="ntpdc-Invocation"></span><div class="header">
    110 <p>
    111 Next: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Previous: <a href="#ntpdc-Description" accesskey="p" rel="prev">ntpdc Description</a>, Up: <a href="#ntpdc-Description" accesskey="u" rel="up">ntpdc Description</a> &nbsp; </p>
    112 </div>
    113 <span id="Invoking-ntpdc"></span><h3 class="section">1.1 Invoking ntpdc</h3>
    114 <span id="index-ntpdc"></span>
    115 <span id="index-vendor_002dspecific-NTPD-control-program"></span>
    116 
    117 
    118 
    119 <p><code>ntpdc</code>
    120 is deprecated.
    121 Please use
    122 <code>ntpq(1ntpqmdoc)</code> instead - it can do everything
    123 <code>ntpdc</code>
    124 used to do, and it does so using a much more sane interface.
    125 </p>
    126 <p><code>ntpdc</code>
    127 is a utility program used to query
    128 <code>ntpd(1ntpdmdoc)</code>
    129 about its
    130 current state and to request changes in that state.
    131 It uses NTP mode 7 control message formats described in the source code.
    132 The program may
    133 be run either in interactive mode or controlled using command line
    134 arguments.
    135 Extensive state and statistics information is available
    136 through the
    137 <code>ntpdc</code>
    138 interface.
    139 In addition, nearly all the
    140 configuration options which can be specified at startup using
    141 ntpd&rsquo;s configuration file may also be specified at run time using
    142 <code>ntpdc</code>
    143 </p>
    144 <p>This section was generated by <strong>AutoGen</strong>,
    145 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpdc</code> program.
    146 This software is released under the NTP license, &lt;http://ntp.org/license>;.
    147 </p>
    148 <table class="menu" border="0" cellspacing="0">
    149 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-usage" accesskey="1">ntpdc usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ntpdc help/usage (<samp>--help</samp>)
    150 </td></tr>
    151 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-ipv4" accesskey="2">ntpdc ipv4</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ipv4 option (-4)
    152 </td></tr>
    153 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-ipv6" accesskey="3">ntpdc ipv6</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ipv6 option (-6)
    154 </td></tr>
    155 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-command" accesskey="4">ntpdc command</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">command option (-c)
    156 </td></tr>
    157 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-interactive" accesskey="5">ntpdc interactive</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">interactive option (-i)
    158 </td></tr>
    159 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-listpeers" accesskey="6">ntpdc listpeers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">listpeers option (-l)
    160 </td></tr>
    161 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-numeric" accesskey="7">ntpdc numeric</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">numeric option (-n)
    162 </td></tr>
    163 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-peers" accesskey="8">ntpdc peers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">peers option (-p)
    164 </td></tr>
    165 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-showpeers" accesskey="9">ntpdc showpeers</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">showpeers option (-s)
    166 </td></tr>
    167 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-unconnected">ntpdc unconnected</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">unconnected option (-u)
    168 </td></tr>
    169 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-config">ntpdc config</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">presetting/configuring ntpdc
    170 </td></tr>
    171 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-exit-status">ntpdc exit status</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
    172 </td></tr>
    173 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-Usage">ntpdc Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Usage
    174 </td></tr>
    175 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-See-Also">ntpdc See Also</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">See Also
    176 </td></tr>
    177 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-Authors">ntpdc Authors</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Authors
    178 </td></tr>
    179 <tr><td align="left" valign="top">&bull; <a href="#ntpdc-Bugs">ntpdc Bugs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Bugs
    180 </td></tr>
    181 </table>
    182 
    183 <hr>
    184 <span id="ntpdc-usage"></span><div class="header">
    185 <p>
    186 Next: <a href="#ntpdc-ipv4" accesskey="n" rel="next">ntpdc ipv4</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    187 </div>
    188 <span id="ntpdc-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.1.1 ntpdc help/usage (<samp>--help</samp>)</h4>
    189 <span id="index-ntpdc-help"></span>
    190 
    191 <p>This is the automatically generated usage text for ntpdc.
    192 </p>
    193 <p>The text printed is the same whether selected with the <code>help</code> option
    194 (<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
    195 the usage text by passing it through a pager program.
    196 <code>more-help</code> is disabled on platforms without a working
    197 <code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
    198 used to select the program, defaulting to <samp>more</samp>.  Both will exit
    199 with a status code of 0.
    200 </p>
    201 <div class="example">
    202 <pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p18
    203 Usage:  ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
    204   Flg Arg Option-Name    Description
    205    -4 no  ipv4           Force IPv4 DNS name resolution
    206                                 - prohibits the option 'ipv6'
    207    -6 no  ipv6           Force IPv6 DNS name resolution
    208                                 - prohibits the option 'ipv4'
    209    -c Str command        run a command and exit
    210                                 - may appear multiple times
    211    -d no  debug-level    Increase debug verbosity level
    212                                 - may appear multiple times
    213    -D Num set-debug-level Set the debug verbosity level
    214                                 - may appear multiple times
    215    -i no  interactive    Force ntpq to operate in interactive mode
    216                                 - prohibits these options:
    217                                 command
    218                                 listpeers
    219                                 peers
    220                                 showpeers
    221    -l no  listpeers      Print a list of the peers
    222                                 - prohibits the option 'command'
    223    -n no  numeric        numeric host addresses
    224    -p no  peers          Print a list of the peers
    225                                 - prohibits the option 'command'
    226    -s no  showpeers      Show a list of the peers
    227                                 - prohibits the option 'command'
    228    -u no  unconnected    Use unconnected UDP to communicate with ntpd (default on Windows)
    229       opt version        output version information and exit
    230    -? no  help           display extended usage information and exit
    231    -! no  more-help      extended usage information passed thru pager
    232    -&gt; opt save-opts      save the option state to a config file
    233    -&lt; Str load-opts      load options from a config file
    234                                 - disabled as '--no-load-opts'
    235                                 - may appear multiple times
    236 
    237 Options are specified by doubled hyphens and their name or by a single
    238 hyphen and the flag character.
    239 
    240 
    241 The following option preset mechanisms are supported:
    242  - reading file $HOME/.ntprc
    243  - reading file ./.ntprc
    244  - examining environment variables named NTPDC_*
    245 
    246 Please send bug reports to:  &lt;https://bugs.ntp.org, bugs (a] ntp.org&gt;
    247 </pre></div>
    248 
    249 <hr>
    250 <span id="ntpdc-ipv4"></span><div class="header">
    251 <p>
    252 Next: <a href="#ntpdc-ipv6" accesskey="n" rel="next">ntpdc ipv6</a>, Previous: <a href="#ntpdc-usage" accesskey="p" rel="prev">ntpdc usage</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    253 </div>
    254 <span id="ipv4-option-_0028_002d4_0029"></span><h4 class="subsection">1.1.2 ipv4 option (-4)</h4>
    255 <span id="index-ntpdc_002dipv4"></span>
    256 
    257 <p>This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
    258 </p>
    259 <p>This option has some usage constraints.  It:
    260 </p><ul>
    261 <li> must not appear in combination with any of the following options:
    262 ipv6.
    263 </li></ul>
    264 
    265 <p>Force DNS resolution of following host names on the command line
    266 to the IPv4 namespace.
    267 </p><hr>
    268 <span id="ntpdc-ipv6"></span><div class="header">
    269 <p>
    270 Next: <a href="#ntpdc-command" accesskey="n" rel="next">ntpdc command</a>, Previous: <a href="#ntpdc-ipv4" accesskey="p" rel="prev">ntpdc ipv4</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    271 </div>
    272 <span id="ipv6-option-_0028_002d6_0029"></span><h4 class="subsection">1.1.3 ipv6 option (-6)</h4>
    273 <span id="index-ntpdc_002dipv6"></span>
    274 
    275 <p>This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
    276 </p>
    277 <p>This option has some usage constraints.  It:
    278 </p><ul>
    279 <li> must not appear in combination with any of the following options:
    280 ipv4.
    281 </li></ul>
    282 
    283 <p>Force DNS resolution of following host names on the command line
    284 to the IPv6 namespace.
    285 </p><hr>
    286 <span id="ntpdc-command"></span><div class="header">
    287 <p>
    288 Next: <a href="#ntpdc-interactive" accesskey="n" rel="next">ntpdc interactive</a>, Previous: <a href="#ntpdc-ipv6" accesskey="p" rel="prev">ntpdc ipv6</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    289 </div>
    290 <span id="command-option-_0028_002dc_0029"></span><h4 class="subsection">1.1.4 command option (-c)</h4>
    291 <span id="index-ntpdc_002dcommand"></span>
    292 
    293 <p>This is the &ldquo;run a command and exit&rdquo; option.
    294 This option takes a string argument <samp>cmd</samp>.
    295 </p>
    296 <p>This option has some usage constraints.  It:
    297 </p><ul>
    298 <li> may appear an unlimited number of times.
    299 </li></ul>
    300 
    301 <p>The following argument is interpreted as an interactive format command
    302 and is added to the list of commands to be executed on the specified
    303 host(s).
    304 </p><hr>
    305 <span id="ntpdc-interactive"></span><div class="header">
    306 <p>
    307 Next: <a href="#ntpdc-listpeers" accesskey="n" rel="next">ntpdc listpeers</a>, Previous: <a href="#ntpdc-command" accesskey="p" rel="prev">ntpdc command</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    308 </div>
    309 <span id="interactive-option-_0028_002di_0029"></span><h4 class="subsection">1.1.5 interactive option (-i)</h4>
    310 <span id="index-ntpdc_002dinteractive"></span>
    311 
    312 <p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
    313 </p>
    314 <p>This option has some usage constraints.  It:
    315 </p><ul>
    316 <li> must not appear in combination with any of the following options:
    317 command, listpeers, peers, showpeers.
    318 </li></ul>
    319 
    320 <p>Force ntpq to operate in interactive mode.  Prompts will be written
    321 to the standard output and commands read from the standard input.
    322 </p><hr>
    323 <span id="ntpdc-listpeers"></span><div class="header">
    324 <p>
    325 Next: <a href="#ntpdc-numeric" accesskey="n" rel="next">ntpdc numeric</a>, Previous: <a href="#ntpdc-interactive" accesskey="p" rel="prev">ntpdc interactive</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    326 </div>
    327 <span id="listpeers-option-_0028_002dl_0029"></span><h4 class="subsection">1.1.6 listpeers option (-l)</h4>
    328 <span id="index-ntpdc_002dlistpeers"></span>
    329 
    330 <p>This is the &ldquo;print a list of the peers&rdquo; option.
    331 </p>
    332 <p>This option has some usage constraints.  It:
    333 </p><ul>
    334 <li> must not appear in combination with any of the following options:
    335 command.
    336 </li></ul>
    337 
    338 <p>Print a list of the peers known to the server as well as a summary of
    339 their state. This is equivalent to the &rsquo;listpeers&rsquo; interactive command.
    340 </p><hr>
    341 <span id="ntpdc-numeric"></span><div class="header">
    342 <p>
    343 Next: <a href="#ntpdc-peers" accesskey="n" rel="next">ntpdc peers</a>, Previous: <a href="#ntpdc-listpeers" accesskey="p" rel="prev">ntpdc listpeers</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    344 </div>
    345 <span id="numeric-option-_0028_002dn_0029"></span><h4 class="subsection">1.1.7 numeric option (-n)</h4>
    346 <span id="index-ntpdc_002dnumeric"></span>
    347 
    348 <p>This is the &ldquo;numeric host addresses&rdquo; option.
    349 Output all host addresses in dotted-quad numeric format rather than
    350 converting to the canonical host names. 
    351 </p><hr>
    352 <span id="ntpdc-peers"></span><div class="header">
    353 <p>
    354 Next: <a href="#ntpdc-showpeers" accesskey="n" rel="next">ntpdc showpeers</a>, Previous: <a href="#ntpdc-numeric" accesskey="p" rel="prev">ntpdc numeric</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    355 </div>
    356 <span id="peers-option-_0028_002dp_0029"></span><h4 class="subsection">1.1.8 peers option (-p)</h4>
    357 <span id="index-ntpdc_002dpeers"></span>
    358 
    359 <p>This is the &ldquo;print a list of the peers&rdquo; option.
    360 </p>
    361 <p>This option has some usage constraints.  It:
    362 </p><ul>
    363 <li> must not appear in combination with any of the following options:
    364 command.
    365 </li></ul>
    366 
    367 <p>Print a list of the peers known to the server as well as a summary
    368 of their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
    369 </p><hr>
    370 <span id="ntpdc-showpeers"></span><div class="header">
    371 <p>
    372 Next: <a href="#ntpdc-unconnected" accesskey="n" rel="next">ntpdc unconnected</a>, Previous: <a href="#ntpdc-peers" accesskey="p" rel="prev">ntpdc peers</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    373 </div>
    374 <span id="showpeers-option-_0028_002ds_0029"></span><h4 class="subsection">1.1.9 showpeers option (-s)</h4>
    375 <span id="index-ntpdc_002dshowpeers"></span>
    376 
    377 <p>This is the &ldquo;show a list of the peers&rdquo; option.
    378 </p>
    379 <p>This option has some usage constraints.  It:
    380 </p><ul>
    381 <li> must not appear in combination with any of the following options:
    382 command.
    383 </li></ul>
    384 
    385 <p>Print a list of the peers known to the server as well as a summary
    386 of their state. This is equivalent to the &rsquo;dmpeers&rsquo; interactive command.
    387 </p><hr>
    388 <span id="ntpdc-unconnected"></span><div class="header">
    389 <p>
    390 Next: <a href="#ntpdc-config" accesskey="n" rel="next">ntpdc config</a>, Previous: <a href="#ntpdc-showpeers" accesskey="p" rel="prev">ntpdc showpeers</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    391 </div>
    392 <span id="unconnected-option-_0028_002du_0029"></span><h4 class="subsection">1.1.10 unconnected option (-u)</h4>
    393 <span id="index-ntpdc_002dunconnected"></span>
    394 
    395 <p>This is the &ldquo;use unconnected udp to communicate with ntpd (default on windows)&rdquo; option.
    396 Open an unconnected UDP association to ntpd (the default
    397 on Windows).
    398 </p>
    399 
    400 <hr>
    401 <span id="ntpdc-config"></span><div class="header">
    402 <p>
    403 Next: <a href="#ntpdc-exit-status" accesskey="n" rel="next">ntpdc exit status</a>, Previous: <a href="#ntpdc-unconnected" accesskey="p" rel="prev">ntpdc unconnected</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    404 </div>
    405 <span id="presetting_002fconfiguring-ntpdc"></span><h4 class="subsection">1.1.11 presetting/configuring ntpdc</h4>
    406 
    407 <p>Any option that is not marked as <i>not presettable</i> may be preset by
    408 loading values from configuration (&quot;rc&quot; or &quot;ini&quot;) files, and values from environment variables named <code>NTPDC</code> and <code>NTPDC_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
    409 the options listed above in upper case and segmented with underscores.
    410 The <code>NTPDC</code> variable will be tokenized and parsed like
    411 the command line.  The remaining variables are tested for existence and their
    412 values are treated like option arguments.
    413 </p>
    414 
    415 <p><code>libopts</code> will search in 2 places for configuration files:
    416 </p><ul>
    417 <li> $HOME
    418 </li><li> $PWD
    419 </li></ul>
    420 <p>The environment variables <code>HOME</code>, and <code>PWD</code>
    421 are expanded and replaced when <samp>ntpdc</samp> runs.
    422 For any of these that are plain files, they are simply processed.
    423 For any that are directories, then a file named <samp>.ntprc</samp> is searched for
    424 within that directory and processed.
    425 </p>
    426 <p>Configuration files may be in a wide variety of formats.
    427 The basic format is an option name followed by a value (argument) on the
    428 same line.  Values may be separated from the option name with a colon,
    429 equal sign or simply white space.  Values may be continued across multiple
    430 lines by escaping the newline with a backslash.
    431 </p>
    432 <p>Multiple programs may also share the same initialization file.
    433 Common options are collected at the top, followed by program specific
    434 segments.  The segments are separated by lines like:
    435 </p><div class="example">
    436 <pre class="example">[NTPDC]
    437 </pre></div>
    438 <p>or by
    439 </p><div class="example">
    440 <pre class="example">&lt;?program ntpdc&gt;
    441 </pre></div>
    442 <p>Do not mix these styles within one configuration file.
    443 </p>
    444 <p>Compound values and carefully constructed string values may also be
    445 specified using XML syntax:
    446 </p><div class="example">
    447 <pre class="example">&lt;option-name&gt;
    448    &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
    449 &lt;/option-name&gt;
    450 </pre></div>
    451 <p>yielding an <code>option-name.sub-opt</code> string value of
    452 </p><div class="example">
    453 <pre class="example">&quot;...&lt;...&gt;...&quot;
    454 </pre></div>
    455 <p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
    456 hierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
    457 the associated name/value pair list (see: optionFindValue).
    458 </p>
    459 <p>The command line options relating to configuration and/or usage help are:
    460 </p>
    461 <span id="version-_0028_002d_0029"></span><h4 class="subsubheading">version (-)</h4>
    462 
    463 <p>Print the program version to standard out, optionally with licensing
    464 information, then exit 0.  The optional argument specifies how much licensing
    465 detail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
    466 Only the first letter of the argument is examined:
    467 </p>
    468 <dl compact="compact">
    469 <dt>&lsquo;<samp>version</samp>&rsquo;</dt>
    470 <dd><p>Only print the version.  This is the default.
    471 </p></dd>
    472 <dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
    473 <dd><p>Name the copyright usage licensing terms.
    474 </p></dd>
    475 <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
    476 <dd><p>Print the full copyright usage licensing terms.
    477 </p></dd>
    478 </dl>
    479 
    480 <hr>
    481 <span id="ntpdc-exit-status"></span><div class="header">
    482 <p>
    483 Next: <a href="#ntpdc-Usage" accesskey="n" rel="next">ntpdc Usage</a>, Previous: <a href="#ntpdc-config" accesskey="p" rel="prev">ntpdc config</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    484 </div>
    485 <span id="ntpdc-exit-status-1"></span><h4 class="subsection">1.1.12 ntpdc exit status</h4>
    486 
    487 <p>One of the following exit values will be returned:
    488 </p><dl compact="compact">
    489 <dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
    490 <dd><p>Successful program execution.
    491 </p></dd>
    492 <dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
    493 <dd><p>The operation failed or the command syntax was not valid.
    494 </p></dd>
    495 <dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
    496 <dd><p>A specified configuration file could not be loaded.
    497 </p></dd>
    498 <dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
    499 <dd><p>libopts had an internal operational error.  Please report
    500 it to autogen-users (a] lists.sourceforge.net.  Thank you.
    501 </p></dd>
    502 </dl>
    503 <hr>
    504 <span id="ntpdc-Usage"></span><div class="header">
    505 <p>
    506 Next: <a href="#ntpdc-See-Also" accesskey="n" rel="next">ntpdc See Also</a>, Previous: <a href="#ntpdc-exit-status" accesskey="p" rel="prev">ntpdc exit status</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    507 </div>
    508 <span id="ntpdc-Usage-1"></span><h4 class="subsection">1.1.13 ntpdc Usage</h4>
    509 <hr>
    510 <span id="ntpdc-See-Also"></span><div class="header">
    511 <p>
    512 Next: <a href="#ntpdc-Authors" accesskey="n" rel="next">ntpdc Authors</a>, Previous: <a href="#ntpdc-Usage" accesskey="p" rel="prev">ntpdc Usage</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    513 </div>
    514 <span id="ntpdc-See-Also-1"></span><h4 class="subsection">1.1.14 ntpdc See Also</h4>
    515 <hr>
    516 <span id="ntpdc-Authors"></span><div class="header">
    517 <p>
    518 Next: <a href="#ntpdc-Bugs" accesskey="n" rel="next">ntpdc Bugs</a>, Previous: <a href="#ntpdc-See-Also" accesskey="p" rel="prev">ntpdc See Also</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    519 </div>
    520 <span id="ntpdc-Authors-1"></span><h4 class="subsection">1.1.15 ntpdc Authors</h4>
    521 <hr>
    522 <span id="ntpdc-Bugs"></span><div class="header">
    523 <p>
    524 Previous: <a href="#ntpdc-Authors" accesskey="p" rel="prev">ntpdc Authors</a>, Up: <a href="#ntpdc-Invocation" accesskey="u" rel="up">ntpdc Invocation</a> &nbsp; </p>
    525 </div>
    526 <span id="ntpdc-Bugs-1"></span><h4 class="subsection">1.1.16 ntpdc Bugs</h4>
    527 
    528 <hr>
    529 <span id="Usage"></span><div class="header">
    530 <p>
    531 Previous: <a href="#ntpdc-Invocation" accesskey="p" rel="prev">ntpdc Invocation</a>, Up: <a href="#ntpdc-Description" accesskey="u" rel="up">ntpdc Description</a> &nbsp; </p>
    532 </div>
    533 <span id="Usage-1"></span><h3 class="section">1.2 Usage</h3>
    534 
    535 <p>The simplest use of this program is as an unprivileged command to
    536 check the current time, offset, and error in the local clock.
    537 For example:
    538 </p>
    539 <div class="example">
    540 <pre class="example">ntpdc ntpserver.somewhere
    541 </pre></div>
    542 
    543 <p>With suitable privilege, it can be run as a command or in a
    544 <code>cron</code> job to reset the local clock from a reliable server, like
    545 the <code>ntpdate</code> and <code>rdate</code> commands.
    546 For example:
    547 </p>
    548 <div class="example">
    549 <pre class="example">ntpdc -a ntpserver.somewhere
    550 </pre></div>
    551 <hr>
    552 
    553 
    554 
    555 </body>
    556 </html>
    557