3 <title>ntpd: Network Time Protocol (NTP) Daemon User's Manual</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="ntpd: Network Time Protocol (NTP) Daemon 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; }
22 <h1 class="settitle">ntpd: Network Time Protocol (NTP) Daemon User's Manual</h1>
25 <a name="Top"></a>Next: <a rel="next" accesskey="n" href="#ntpd-Description">ntpd Description</a>,
26 Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
27 Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
31 <h2 class="unnumbered">ntpd: Network Time Protocol (NTP) Daemon User Manual</h2>
33 <p>The <code>ntpd</code> program is an operating system daemon that synchronizes the
34 system clock to remote NTP time servers or local reference clocks.
35 It is a complete implementation of NTP version 4 defined by RFC-5905, but
36 also retains compatible with version 3 defined by RFC-1305 and versions
37 1 and 2, defined by RFC-1059 and RFC-1119, respectively.
38 The program can operate in any of several modes, including client/server,
39 symmetric and broadcast modes, and with both symmetric-key and public-key
42 <p>This document applies to version 4.2.8p8 of <code>ntpd</code>.
45 <li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
46 <li><a accesskey="2" href="#ntpd-Invocation">ntpd Invocation</a>: Invoking ntpd
47 <li><a accesskey="3" href="#Usage">Usage</a>: Usage
52 <a name="ntpd-Description"></a>
56 <!-- node-name, next, previous, up -->
57 <h3 class="section">Description</h3>
59 <p>The <code>ntpd</code> program ordinarily requires
60 a configuration file described at <a href="#ntp_002econf">ntp.conf</a>.
61 This configuration file contains configuration commands described on
62 the pages listed above.
63 However a client can discover remote servers and configure them
65 This makes it possible to deploy a fleet of workstations without
66 specifying configuration details specific to the local environment.
68 <p>The <code>ntpd</code> program normally operates continuously while adjusting the
69 system time and frequency, but in some cases this might not be
71 With the <code>-q</code> option <code>ntpd</code> operates as in continuous mode, but
72 exits just after setting the clock for the first time.
73 Most applications will probably want to specify the <code>iburst</code>
74 option with the <code>server</code> command.
75 With this option an initial volley of messages is exchanged to
76 groom the data and set the clock in about ten seconds' time.
77 If nothing is heard after a few minutes' time,
78 the daemon times out and exits without setting the clock.
82 <a name="ntpd-Invocation"></a>
86 <h3 class="section">Invoking ntpd</h3>
88 <p><a name="index-ntpd-1"></a><a name="index-NTP-daemon-program-2"></a>
92 utility is an operating system daemon which sets
93 and maintains the system time of day in synchronism with Internet
94 standard time servers.
95 It is a complete implementation of the
96 Network Time Protocol (NTP) version 4, as defined by RFC-5905,
97 but also retains compatibility with
98 version 3, as defined by RFC-1305, and versions 1
99 and 2, as defined by RFC-1059 and RFC-1119, respectively.
103 utility does most computations in 64-bit floating point
104 arithmetic and does relatively clumsy 64-bit fixed point operations
105 only when necessary to preserve the ultimate precision, about 232
107 While the ultimate precision is not achievable with
108 ordinary workstations and networks of today, it may be required
109 with future gigahertz CPU clocks and gigabit LANs.
114 <code>ntp.conf(5)</code>
115 configuration file at startup time in order to determine the
116 synchronization sources and operating modes.
117 It is also possible to
118 specify a working, although limited, configuration entirely on the
119 command line, obviating the need for a configuration file.
121 be particularly useful when the local host is to be configured as a
122 broadcast/multicast client, with all peers being determined by
123 listening to broadcasts at run time.
125 <p>If NetInfo support is built into
129 will attempt to read its configuration from the
130 NetInfo if the default
131 <code>ntp.conf(5)</code>
132 file cannot be read and no file is
139 variables can be displayed and
140 configuration options altered while the
144 <code>ntpq(1ntpqmdoc)</code>
146 <code>ntpdc(1ntpdcmdoc)</code>
151 starts it looks at the value of
152 <code>umask(2)</code>,
156 <code>umask(2)</code>
159 <p>This section was generated by <strong>AutoGen</strong>,
160 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpd</code> program.
161 This software is released under the NTP license, <http://ntp.org/license>.
164 <li><a accesskey="1" href="#ntpd-usage">ntpd usage</a>: ntpd help/usage (<span class="option">--help</span>)
165 <li><a accesskey="2" href="#ntpd-ipv4">ntpd ipv4</a>: ipv4 option (-4)
166 <li><a accesskey="3" href="#ntpd-ipv6">ntpd ipv6</a>: ipv6 option (-6)
167 <li><a accesskey="4" href="#ntpd-authreq">ntpd authreq</a>: authreq option (-a)
168 <li><a accesskey="5" href="#ntpd-authnoreq">ntpd authnoreq</a>: authnoreq option (-A)
169 <li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>: configfile option (-c)
170 <li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>: driftfile option (-f)
171 <li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>: panicgate option (-g)
172 <li><a accesskey="9" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>: force-step-once option (-G)
173 <li><a href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i)
174 <li><a href="#ntpd-interface">ntpd interface</a>: interface option (-I)
175 <li><a href="#ntpd-keyfile">ntpd keyfile</a>: keyfile option (-k)
176 <li><a href="#ntpd-logfile">ntpd logfile</a>: logfile option (-l)
177 <li><a href="#ntpd-novirtualips">ntpd novirtualips</a>: novirtualips option (-L)
178 <li><a href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>: modifymmtimer option (-M)
179 <li><a href="#ntpd-nice">ntpd nice</a>: nice option (-N)
180 <li><a href="#ntpd-pidfile">ntpd pidfile</a>: pidfile option (-p)
181 <li><a href="#ntpd-priority">ntpd priority</a>: priority option (-P)
182 <li><a href="#ntpd-quit">ntpd quit</a>: quit option (-q)
183 <li><a href="#ntpd-propagationdelay">ntpd propagationdelay</a>: propagationdelay option (-r)
184 <li><a href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>: saveconfigquit option
185 <li><a href="#ntpd-statsdir">ntpd statsdir</a>: statsdir option (-s)
186 <li><a href="#ntpd-trustedkey">ntpd trustedkey</a>: trustedkey option (-t)
187 <li><a href="#ntpd-user">ntpd user</a>: user option (-u)
188 <li><a href="#ntpd-updateinterval">ntpd updateinterval</a>: updateinterval option (-U)
189 <li><a href="#ntpd-wait_002dsync">ntpd wait-sync</a>: wait-sync option (-w)
190 <li><a href="#ntpd-slew">ntpd slew</a>: slew option (-x)
191 <li><a href="#ntpd-usepcc">ntpd usepcc</a>: usepcc option
192 <li><a href="#ntpd-pccfreq">ntpd pccfreq</a>: pccfreq option
193 <li><a href="#ntpd-mdns">ntpd mdns</a>: mdns option (-m)
194 <li><a href="#ntpd-config">ntpd config</a>: presetting/configuring ntpd
195 <li><a href="#ntpd-exit-status">ntpd exit status</a>: exit status
196 <li><a href="#ntpd-Usage">ntpd Usage</a>: Usage
197 <li><a href="#ntpd-Files">ntpd Files</a>: Files
198 <li><a href="#ntpd-See-Also">ntpd See Also</a>: See Also
199 <li><a href="#ntpd-Bugs">ntpd Bugs</a>: Bugs
200 <li><a href="#ntpd-Notes">ntpd Notes</a>: Notes
205 <a name="ntpd-usage"></a>Next: <a rel="next" accesskey="n" href="#ntpd-ipv4">ntpd ipv4</a>,
206 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
210 <h4 class="subsection">ntpd help/usage (<span class="option">--help</span>)</h4>
212 <p><a name="index-ntpd-help-3"></a>
213 This is the automatically generated usage text for ntpd.
215 <p>The text printed is the same whether selected with the <code>help</code> option
216 (<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
217 the usage text by passing it through a pager program.
218 <code>more-help</code> is disabled on platforms without a working
219 <code>fork(2)</code> function. The <code>PAGER</code> environment variable is
220 used to select the program, defaulting to <span class="file">more</span>. Both will exit
221 with a status code of 0.
223 <pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p7
224 Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
225 [ <server1> ... <serverN> ]
226 Flg Arg Option-Name Description
227 -4 no ipv4 Force IPv4 DNS name resolution
228 - prohibits the option 'ipv6'
229 -6 no ipv6 Force IPv6 DNS name resolution
230 - prohibits the option 'ipv4'
231 -a no authreq Require crypto authentication
232 - prohibits the option 'authnoreq'
233 -A no authnoreq Do not require crypto authentication
234 - prohibits the option 'authreq'
235 -b no bcastsync Allow us to sync to broadcast servers
236 -c Str configfile configuration file name
237 -d no debug-level Increase debug verbosity level
238 - may appear multiple times
239 -D Num set-debug-level Set the debug verbosity level
240 - may appear multiple times
241 -f Str driftfile frequency drift file name
242 -g no panicgate Allow the first adjustment to be Big
243 - may appear multiple times
244 -G no force-step-once Step any initial offset correction.
245 -i Str jaildir Jail directory
246 -I Str interface Listen on an interface name or address
247 - may appear multiple times
248 -k Str keyfile path to symmetric keys
249 -l Str logfile path to the log file
250 -L no novirtualips Do not listen to virtual interfaces
251 -n no nofork Do not fork
252 - prohibits the option 'wait-sync'
253 -N no nice Run at high priority
254 -p Str pidfile path to the PID file
255 -P Num priority Process priority
256 -q no quit Set the time and quit
257 - prohibits these options:
260 -r Str propagationdelay Broadcast/propagation delay
261 Str saveconfigquit Save parsed configuration and quit
262 - prohibits these options:
265 -s Str statsdir Statistics file location
266 -t Str trustedkey Trusted key number
267 - may appear multiple times
268 -u Str user Run as userid (or userid:groupid)
269 -U Num updateinterval interval in seconds between scans for new or dropped interfaces
270 Str var make ARG an ntp variable (RW)
271 - may appear multiple times
272 Str dvar make ARG an ntp variable (RW|DEF)
273 - may appear multiple times
274 -w Num wait-sync Seconds to wait for first clock sync
275 - prohibits these options:
279 -x no slew Slew up to 600 seconds
280 opt version output version information and exit
281 -? no help display extended usage information and exit
282 -! no more-help extended usage information passed thru pager
284 Options are specified by doubled hyphens and their name or by a single
285 hyphen and the flag character.
288 The following option preset mechanisms are supported:
289 - examining environment variables named NTPD_*
291 Please send bug reports to: <http://bugs.ntp.org, bugs@ntp.org>
295 <a name="ntpd-ipv4"></a>Next: <a rel="next" accesskey="n" href="#ntpd-ipv6">ntpd ipv6</a>,
296 Previous: <a rel="previous" accesskey="p" href="#ntpd-usage">ntpd usage</a>,
297 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
301 <h4 class="subsection">ipv4 option (-4)</h4>
303 <p><a name="index-ntpd_002dipv4-4"></a>
304 This is the “force ipv4 dns name resolution” option.
306 <p class="noindent">This option has some usage constraints. It:
308 <li>must not appear in combination with any of the following options:
312 <p>Force DNS resolution of following host names on the command line
313 to the IPv4 namespace.
316 <a name="ntpd-ipv6"></a>Next: <a rel="next" accesskey="n" href="#ntpd-authreq">ntpd authreq</a>,
317 Previous: <a rel="previous" accesskey="p" href="#ntpd-ipv4">ntpd ipv4</a>,
318 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
322 <h4 class="subsection">ipv6 option (-6)</h4>
324 <p><a name="index-ntpd_002dipv6-5"></a>
325 This is the “force ipv6 dns name resolution” option.
327 <p class="noindent">This option has some usage constraints. It:
329 <li>must not appear in combination with any of the following options:
333 <p>Force DNS resolution of following host names on the command line
334 to the IPv6 namespace.
337 <a name="ntpd-authreq"></a>Next: <a rel="next" accesskey="n" href="#ntpd-authnoreq">ntpd authnoreq</a>,
338 Previous: <a rel="previous" accesskey="p" href="#ntpd-ipv6">ntpd ipv6</a>,
339 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
343 <h4 class="subsection">authreq option (-a)</h4>
345 <p><a name="index-ntpd_002dauthreq-6"></a>
346 This is the “require crypto authentication” option.
348 <p class="noindent">This option has some usage constraints. It:
350 <li>must not appear in combination with any of the following options:
354 <p>Require cryptographic authentication for broadcast client,
355 multicast client and symmetric passive associations.
359 <a name="ntpd-authnoreq"></a>Next: <a rel="next" accesskey="n" href="#ntpd-configfile">ntpd configfile</a>,
360 Previous: <a rel="previous" accesskey="p" href="#ntpd-authreq">ntpd authreq</a>,
361 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
365 <h4 class="subsection">authnoreq option (-A)</h4>
367 <p><a name="index-ntpd_002dauthnoreq-7"></a>
368 This is the “do not require crypto authentication” option.
370 <p class="noindent">This option has some usage constraints. It:
372 <li>must not appear in combination with any of the following options:
376 <p>Do not require cryptographic authentication for broadcast client,
377 multicast client and symmetric passive associations.
378 This is almost never a good idea.
381 <a name="ntpd-configfile"></a>Next: <a rel="next" accesskey="n" href="#ntpd-driftfile">ntpd driftfile</a>,
382 Previous: <a rel="previous" accesskey="p" href="#ntpd-authnoreq">ntpd authnoreq</a>,
383 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
387 <h4 class="subsection">configfile option (-c)</h4>
389 <p><a name="index-ntpd_002dconfigfile-8"></a>
390 This is the “configuration file name” option.
391 This option takes a string argument.
392 The name and path of the configuration file,
393 <span class="file">/etc/ntp.conf</span>
397 <a name="ntpd-driftfile"></a>Next: <a rel="next" accesskey="n" href="#ntpd-panicgate">ntpd panicgate</a>,
398 Previous: <a rel="previous" accesskey="p" href="#ntpd-configfile">ntpd configfile</a>,
399 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
403 <h4 class="subsection">driftfile option (-f)</h4>
405 <p><a name="index-ntpd_002ddriftfile-9"></a>
406 This is the “frequency drift file name” option.
407 This option takes a string argument.
408 The name and path of the frequency file,
409 <span class="file">/etc/ntp.drift</span>
411 This is the same operation as the
412 <code>driftfile</code> <kbd>driftfile</kbd>
413 configuration specification in the
414 <span class="file">/etc/ntp.conf</span>
418 <a name="ntpd-panicgate"></a>Next: <a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
419 Previous: <a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
420 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
424 <h4 class="subsection">panicgate option (-g)</h4>
426 <p><a name="index-ntpd_002dpanicgate-10"></a>
427 This is the “allow the first adjustment to be big” option.
429 <p class="noindent">This option has some usage constraints. It:
431 <li>may appear an unlimited number of times.
436 exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
438 will exit with a message to the system log. This option can be used with the
445 configuration file directive for other options.
448 <a name="ntpd-force_002dstep_002donce"></a>Next: <a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
449 Previous: <a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
450 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
454 <h4 class="subsection">force-step-once option (-G)</h4>
456 <p><a name="index-ntpd_002dforce_002dstep_002donce-11"></a>
457 This is the “step any initial offset correction.” option.
460 steps the time if the time offset exceeds the step threshold,
461 which is 128 ms by default, and otherwise slews the time.
462 This option forces the initial offset correction to be stepped,
463 so the highest time accuracy can be achieved quickly.
464 However, this may also cause the time to be stepped back
465 so this option must not be used if
466 applications requiring monotonic time are running.
467 See the <code>tinker</code> configuration file directive for other options.
470 <a name="ntpd-jaildir"></a>Next: <a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
471 Previous: <a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
472 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
476 <h4 class="subsection">jaildir option (-i)</h4>
478 <p><a name="index-ntpd_002djaildir-12"></a>
479 This is the “jail directory” option.
480 This option takes a string argument.
482 <p class="noindent">This option has some usage constraints. It:
484 <li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
487 <p>Chroot the server to the directory
490 This option also implies that the server attempts to drop root privileges at startup.
491 You may need to also specify a
494 This option is only available if the OS supports adjusting the clock
495 without full root privileges.
496 This option is supported under NetBSD (configure with
497 <code>--enable-clockctl</code>) or Linux (configure with
498 <code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
501 <a name="ntpd-interface"></a>Next: <a rel="next" accesskey="n" href="#ntpd-keyfile">ntpd keyfile</a>,
502 Previous: <a rel="previous" accesskey="p" href="#ntpd-jaildir">ntpd jaildir</a>,
503 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
507 <h4 class="subsection">interface option (-I)</h4>
509 <p><a name="index-ntpd_002dinterface-13"></a>
510 This is the “listen on an interface name or address” option.
511 This option takes a string argument <span class="file">iface</span>.
513 <p class="noindent">This option has some usage constraints. It:
515 <li>may appear an unlimited number of times.
518 <p>Open the network address given, or all the addresses associated with the
519 given interface name. This option may appear multiple times. This option
520 also implies not opening other addresses, except wildcard and localhost.
521 This option is deprecated. Please consider using the configuration file
522 <code>interface</code> command, which is more versatile.
525 <a name="ntpd-keyfile"></a>Next: <a rel="next" accesskey="n" href="#ntpd-logfile">ntpd logfile</a>,
526 Previous: <a rel="previous" accesskey="p" href="#ntpd-interface">ntpd interface</a>,
527 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
531 <h4 class="subsection">keyfile option (-k)</h4>
533 <p><a name="index-ntpd_002dkeyfile-14"></a>
534 This is the “path to symmetric keys” option.
535 This option takes a string argument.
536 Specify the name and path of the symmetric key file.
537 <span class="file">/etc/ntp.keys</span>
539 This is the same operation as the
540 <code>keys</code> <kbd>keyfile</kbd>
541 configuration file directive.
544 <a name="ntpd-logfile"></a>Next: <a rel="next" accesskey="n" href="#ntpd-novirtualips">ntpd novirtualips</a>,
545 Previous: <a rel="previous" accesskey="p" href="#ntpd-keyfile">ntpd keyfile</a>,
546 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
550 <h4 class="subsection">logfile option (-l)</h4>
552 <p><a name="index-ntpd_002dlogfile-15"></a>
553 This is the “path to the log file” option.
554 This option takes a string argument.
555 Specify the name and path of the log file.
556 The default is the system log file.
557 This is the same operation as the
558 <code>logfile</code> <kbd>logfile</kbd>
559 configuration file directive.
562 <a name="ntpd-novirtualips"></a>Next: <a rel="next" accesskey="n" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
563 Previous: <a rel="previous" accesskey="p" href="#ntpd-logfile">ntpd logfile</a>,
564 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
568 <h4 class="subsection">novirtualips option (-L)</h4>
570 <p><a name="index-ntpd_002dnovirtualips-16"></a>
571 This is the “do not listen to virtual interfaces” option.
572 Do not listen to virtual interfaces, defined as those with
573 names containing a colon. This option is deprecated. Please
574 consider using the configuration file <code>interface</code> command, which
578 <a name="ntpd-modifymmtimer"></a>Next: <a rel="next" accesskey="n" href="#ntpd-nice">ntpd nice</a>,
579 Previous: <a rel="previous" accesskey="p" href="#ntpd-novirtualips">ntpd novirtualips</a>,
580 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
584 <h4 class="subsection">modifymmtimer option (-M)</h4>
586 <p><a name="index-ntpd_002dmodifymmtimer-17"></a>
587 This is the “modify multimedia timer (windows only)” option.
589 <p class="noindent">This option has some usage constraints. It:
591 <li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
594 <p>Set the Windows Multimedia Timer to highest resolution. This
595 ensures the resolution does not change while ntpd is running,
596 avoiding timekeeping glitches associated with changes.
599 <a name="ntpd-nice"></a>Next: <a rel="next" accesskey="n" href="#ntpd-pidfile">ntpd pidfile</a>,
600 Previous: <a rel="previous" accesskey="p" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
601 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
605 <h4 class="subsection">nice option (-N)</h4>
607 <p><a name="index-ntpd_002dnice-18"></a>
608 This is the “run at high priority” option.
609 To the extent permitted by the operating system, run
611 at the highest priority.
614 <a name="ntpd-pidfile"></a>Next: <a rel="next" accesskey="n" href="#ntpd-priority">ntpd priority</a>,
615 Previous: <a rel="previous" accesskey="p" href="#ntpd-nice">ntpd nice</a>,
616 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
620 <h4 class="subsection">pidfile option (-p)</h4>
622 <p><a name="index-ntpd_002dpidfile-19"></a>
623 This is the “path to the pid file” option.
624 This option takes a string argument.
625 Specify the name and path of the file used to record
628 This is the same operation as the
629 <code>pidfile</code> <kbd>pidfile</kbd>
630 configuration file directive.
633 <a name="ntpd-priority"></a>Next: <a rel="next" accesskey="n" href="#ntpd-quit">ntpd quit</a>,
634 Previous: <a rel="previous" accesskey="p" href="#ntpd-pidfile">ntpd pidfile</a>,
635 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
639 <h4 class="subsection">priority option (-P)</h4>
641 <p><a name="index-ntpd_002dpriority-20"></a>
642 This is the “process priority” option.
643 This option takes a number argument.
644 To the extent permitted by the operating system, run
647 <code>sched_setscheduler(SCHED_FIFO)</code>
651 <a name="ntpd-quit"></a>Next: <a rel="next" accesskey="n" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
652 Previous: <a rel="previous" accesskey="p" href="#ntpd-priority">ntpd priority</a>,
653 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
657 <h4 class="subsection">quit option (-q)</h4>
659 <p><a name="index-ntpd_002dquit-21"></a>
660 This is the “set the time and quit” option.
662 <p class="noindent">This option has some usage constraints. It:
664 <li>must not appear in combination with any of the following options:
665 saveconfigquit, wait-sync.
669 will not daemonize and will exit after the clock is first
670 synchronized. This behavior mimics that of the
672 program, which will soon be replaced with a shell script.
677 options can be used with this option.
678 Note: The kernel time discipline is disabled with this option.
681 <a name="ntpd-propagationdelay"></a>Next: <a rel="next" accesskey="n" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
682 Previous: <a rel="previous" accesskey="p" href="#ntpd-quit">ntpd quit</a>,
683 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
687 <h4 class="subsection">propagationdelay option (-r)</h4>
689 <p><a name="index-ntpd_002dpropagationdelay-22"></a>
690 This is the “broadcast/propagation delay” option.
691 This option takes a string argument.
692 Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
695 <a name="ntpd-saveconfigquit"></a>Next: <a rel="next" accesskey="n" href="#ntpd-statsdir">ntpd statsdir</a>,
696 Previous: <a rel="previous" accesskey="p" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
697 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
701 <h4 class="subsection">saveconfigquit option</h4>
703 <p><a name="index-ntpd_002dsaveconfigquit-23"></a>
704 This is the “save parsed configuration and quit” option.
705 This option takes a string argument.
707 <p class="noindent">This option has some usage constraints. It:
709 <li>must be compiled in by defining <code>SAVECONFIG</code> during the compilation.
710 <li>must not appear in combination with any of the following options:
714 <p>Cause <code>ntpd</code> to parse its startup configuration file and save an
715 equivalent to the given filename and exit. This option was
716 designed for automated testing.
719 <a name="ntpd-statsdir"></a>Next: <a rel="next" accesskey="n" href="#ntpd-trustedkey">ntpd trustedkey</a>,
720 Previous: <a rel="previous" accesskey="p" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
721 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
725 <h4 class="subsection">statsdir option (-s)</h4>
727 <p><a name="index-ntpd_002dstatsdir-24"></a>
728 This is the “statistics file location” option.
729 This option takes a string argument.
730 Specify the directory path for files created by the statistics facility.
731 This is the same operation as the
732 <code>statsdir</code> <kbd>statsdir</kbd>
733 configuration file directive.
736 <a name="ntpd-trustedkey"></a>Next: <a rel="next" accesskey="n" href="#ntpd-user">ntpd user</a>,
737 Previous: <a rel="previous" accesskey="p" href="#ntpd-statsdir">ntpd statsdir</a>,
738 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
742 <h4 class="subsection">trustedkey option (-t)</h4>
744 <p><a name="index-ntpd_002dtrustedkey-25"></a>
745 This is the “trusted key number” option.
746 This option takes a string argument <span class="file">tkey</span>.
748 <p class="noindent">This option has some usage constraints. It:
750 <li>may appear an unlimited number of times.
753 <p>Add the specified key number to the trusted key list.
756 <a name="ntpd-user"></a>Next: <a rel="next" accesskey="n" href="#ntpd-updateinterval">ntpd updateinterval</a>,
757 Previous: <a rel="previous" accesskey="p" href="#ntpd-trustedkey">ntpd trustedkey</a>,
758 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
762 <h4 class="subsection">user option (-u)</h4>
764 <p><a name="index-ntpd_002duser-26"></a>
765 This is the “run as userid (or userid:groupid)” option.
766 This option takes a string argument.
768 <p class="noindent">This option has some usage constraints. It:
770 <li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
773 <p>Specify a user, and optionally a group, to switch to.
774 This option is only available if the OS supports adjusting the clock
775 without full root privileges.
776 This option is supported under NetBSD (configure with
777 <code>--enable-clockctl</code>) or Linux (configure with
778 <code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
781 <a name="ntpd-updateinterval"></a>Next: <a rel="next" accesskey="n" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
782 Previous: <a rel="previous" accesskey="p" href="#ntpd-user">ntpd user</a>,
783 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
787 <h4 class="subsection">updateinterval option (-U)</h4>
789 <p><a name="index-ntpd_002dupdateinterval-27"></a>
790 This is the “interval in seconds between scans for new or dropped interfaces” option.
791 This option takes a number argument.
792 Give the time in seconds between two scans for new or dropped interfaces.
793 For systems with routing socket support the scans will be performed shortly after the interface change
794 has been detected by the system.
795 Use 0 to disable scanning. 60 seconds is the minimum time between scans.
798 <a name="ntpd-wait_002dsync"></a>Next: <a rel="next" accesskey="n" href="#ntpd-slew">ntpd slew</a>,
799 Previous: <a rel="previous" accesskey="p" href="#ntpd-updateinterval">ntpd updateinterval</a>,
800 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
804 <h4 class="subsection">wait-sync option (-w)</h4>
806 <p><a name="index-ntpd_002dwait_002dsync-28"></a>
807 This is the “seconds to wait for first clock sync” option.
808 This option takes a number argument.
810 <p class="noindent">This option has some usage constraints. It:
812 <li>must be compiled in by defining <code>HAVE_WORKING_FORK</code> during the compilation.
813 <li>must not appear in combination with any of the following options:
814 nofork, quit, saveconfigquit.
817 <p>If greater than zero, alters <code>ntpd</code>'s behavior when forking to
818 daemonize. Instead of exiting with status 0 immediately after
819 the fork, the parent waits up to the specified number of
820 seconds for the child to first synchronize the clock. The exit
821 status is zero (success) if the clock was synchronized,
822 otherwise it is <code>ETIMEDOUT</code>.
823 This provides the option for a script starting <code>ntpd</code> to easily
824 wait for the first set of the clock before proceeding.
827 <a name="ntpd-slew"></a>Next: <a rel="next" accesskey="n" href="#ntpd-usepcc">ntpd usepcc</a>,
828 Previous: <a rel="previous" accesskey="p" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
829 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
833 <h4 class="subsection">slew option (-x)</h4>
835 <p><a name="index-ntpd_002dslew-29"></a>
836 This is the “slew up to 600 seconds” option.
837 Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
838 This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
839 Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
840 Thus, an adjustment as much as 600 s will take almost 14 days to complete.
841 This option can be used with the
848 configuration file directive for other options.
849 Note: The kernel time discipline is disabled with this option.
852 <a name="ntpd-usepcc"></a>Next: <a rel="next" accesskey="n" href="#ntpd-pccfreq">ntpd pccfreq</a>,
853 Previous: <a rel="previous" accesskey="p" href="#ntpd-slew">ntpd slew</a>,
854 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
858 <h4 class="subsection">usepcc option</h4>
860 <p><a name="index-ntpd_002dusepcc-30"></a>
861 This is the “use cpu cycle counter (windows only)” option.
863 <p class="noindent">This option has some usage constraints. It:
865 <li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
868 <p>Attempt to substitute the CPU counter for <code>QueryPerformanceCounter</code>.
869 The CPU counter and <code>QueryPerformanceCounter</code> are compared, and if
870 they have the same frequency, the CPU counter (RDTSC on x86) is
871 used directly, saving the overhead of a system call.
874 <a name="ntpd-pccfreq"></a>Next: <a rel="next" accesskey="n" href="#ntpd-mdns">ntpd mdns</a>,
875 Previous: <a rel="previous" accesskey="p" href="#ntpd-usepcc">ntpd usepcc</a>,
876 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
880 <h4 class="subsection">pccfreq option</h4>
882 <p><a name="index-ntpd_002dpccfreq-31"></a>
883 This is the “force cpu cycle counter use (windows only)” option.
884 This option takes a string argument.
886 <p class="noindent">This option has some usage constraints. It:
888 <li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
891 <p>Force substitution the CPU counter for <code>QueryPerformanceCounter</code>.
892 The CPU counter (RDTSC on x86) is used unconditionally with the
893 given frequency (in Hz).
896 <a name="ntpd-mdns"></a>Next: <a rel="next" accesskey="n" href="#ntpd-config">ntpd config</a>,
897 Previous: <a rel="previous" accesskey="p" href="#ntpd-pccfreq">ntpd pccfreq</a>,
898 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
902 <h4 class="subsection">mdns option (-m)</h4>
904 <p><a name="index-ntpd_002dmdns-32"></a>
905 This is the “register with mdns as a ntp server” option.
907 <p class="noindent">This option has some usage constraints. It:
909 <li>must be compiled in by defining <code>HAVE_DNSREGISTRATION</code> during the compilation.
912 <p>Registers as an NTP server with the local mDNS server which allows
913 the server to be discovered via mDNS client lookup.
917 <a name="ntpd-config"></a>Next: <a rel="next" accesskey="n" href="#ntpd-exit-status">ntpd exit status</a>,
918 Previous: <a rel="previous" accesskey="p" href="#ntpd-mdns">ntpd mdns</a>,
919 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
923 <h4 class="subsection">presetting/configuring ntpd</h4>
925 <p>Any option that is not marked as <i>not presettable</i> may be preset by
926 loading values from environment variables named <code>NTPD</code> and <code>NTPD_<OPTION_NAME></code>. <code><OPTION_NAME></code> must be one of
927 the options listed above in upper case and segmented with underscores.
928 The <code>NTPD</code> variable will be tokenized and parsed like
929 the command line. The remaining variables are tested for existence and their
930 values are treated like option arguments.
932 <p>The command line options relating to configuration and/or usage help are:
934 <h5 class="subsubheading">version (-)</h5>
936 <p>Print the program version to standard out, optionally with licensing
937 information, then exit 0. The optional argument specifies how much licensing
938 detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
939 Only the first letter of the argument is examined:
942 <dt><span class="samp">version</span><dd>Only print the version. This is the default.
943 <br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
944 <br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
949 <a name="ntpd-exit-status"></a>Next: <a rel="next" accesskey="n" href="#ntpd-Usage">ntpd Usage</a>,
950 Previous: <a rel="previous" accesskey="p" href="#ntpd-config">ntpd config</a>,
951 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
955 <h4 class="subsection">ntpd exit status</h4>
957 <p>One of the following exit values will be returned:
959 <dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
960 <br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
964 <a name="ntpd-Usage"></a>Next: <a rel="next" accesskey="n" href="#ntpd-Files">ntpd Files</a>,
965 Previous: <a rel="previous" accesskey="p" href="#ntpd-exit-status">ntpd exit status</a>,
966 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
970 <h4 class="subsection">ntpd Usage</h4>
974 <a name="ntpd-Files"></a>Next: <a rel="next" accesskey="n" href="#ntpd-See-Also">ntpd See Also</a>,
975 Previous: <a rel="previous" accesskey="p" href="#ntpd-Usage">ntpd Usage</a>,
976 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
980 <h4 class="subsection">ntpd Files</h4>
984 <a name="ntpd-See-Also"></a>Next: <a rel="next" accesskey="n" href="#ntpd-Bugs">ntpd Bugs</a>,
985 Previous: <a rel="previous" accesskey="p" href="#ntpd-Files">ntpd Files</a>,
986 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
990 <h4 class="subsection">ntpd See Also</h4>
994 <a name="ntpd-Bugs"></a>Next: <a rel="next" accesskey="n" href="#ntpd-Notes">ntpd Notes</a>,
995 Previous: <a rel="previous" accesskey="p" href="#ntpd-See-Also">ntpd See Also</a>,
996 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1000 <h4 class="subsection">ntpd Bugs</h4>
1004 <a name="ntpd-Notes"></a>Previous: <a rel="previous" accesskey="p" href="#ntpd-Bugs">ntpd Bugs</a>,
1005 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1009 <h4 class="subsection">ntpd Notes</h4>
1013 <a name="Usage"></a>
1017 <!-- node-name, next, previous, up -->
1018 <h3 class="section">Usage</h3>