ntpd.html revision 1.1.1.6 1 <html lang="en">
2 <head>
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.8">
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 span.sansserif { font-family:sans-serif; font-weight:normal; }
20 --></style>
21 </head>
22 <body>
23 <h1 class="settitle">ntpd: Network Time Protocol (NTP) Daemon User's Manual</h1>
24 <div class="node">
25 <p><hr>
26 <a name="Top"></a>
27 Next: <a rel="next" accesskey="n" href="#ntpd-Description">ntpd Description</a>,
28 Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
29 Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
30
31 </div>
32
33 <h2 class="unnumbered">ntpd: Network Time Protocol (NTP) Daemon User Manual</h2>
34
35 <p>The <code>ntpd</code> program is an operating system daemon that synchronizes the
36 system clock to remote NTP time servers or local reference clocks.
37 It is a complete implementation of NTP version 4 defined by RFC-5905, but
38 also retains compatible with version 3 defined by RFC-1305 and versions
39 1 and 2, defined by RFC-1059 and RFC-1119, respectively.
40 The program can operate in any of several modes, including client/server,
41 symmetric and broadcast modes, and with both symmetric-key and public-key
42 cryptography.
43
44 <p>This document applies to version 4.2.8p5 of <code>ntpd</code>.
45
46 <ul class="menu">
47 <li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
48 <li><a accesskey="2" href="#ntpd-Invocation">ntpd Invocation</a>: Invoking ntpd
49 <li><a accesskey="3" href="#Usage">Usage</a>: Usage
50 </ul>
51
52 <div class="node">
53 <p><hr>
54 <a name="ntpd-Description"></a>
55
56
57 </div>
58
59 <!-- node-name, next, previous, up -->
60 <h3 class="section">Description</h3>
61
62 <p>The <code>ntpd</code> program ordinarily requires
63 a configuration file described at <a href="#ntp_002econf">ntp.conf</a>.
64 This configuration file contains configuration commands described on
65 the pages listed above.
66 However a client can discover remote servers and configure them
67 automatically.
68 This makes it possible to deploy a fleet of workstations without
69 specifying configuration details specific to the local environment.
70
71 <p>The <code>ntpd</code> program normally operates continuously while adjusting the
72 system time and frequency, but in some cases this might not be
73 practical.
74 With the <code>-q</code> option <code>ntpd</code> operates as in continuous mode, but
75 exits just after setting the clock for the first time.
76 Most applications will probably want to specify the <code>iburst</code>
77 option with the <code>server</code> command.
78 With this option an initial volley of messages is exchanged to
79 groom the data and set the clock in about ten seconds' time.
80 If nothing is heard after a few minutes' time,
81 the daemon times out and exits without setting the clock.
82
83 <div class="node">
84 <p><hr>
85 <a name="ntpd-Invocation"></a>
86
87
88 </div>
89
90 <h3 class="section">Invoking ntpd</h3>
91
92 <p><a name="index-ntpd-1"></a><a name="index-NTP-daemon-program-2"></a>
93
94 <p>The
95 <code>ntpd</code>
96 utility is an operating system daemon which sets
97 and maintains the system time of day in synchronism with Internet
98 standard time servers.
99 It is a complete implementation of the
100 Network Time Protocol (NTP) version 4, as defined by RFC-5905,
101 but also retains compatibility with
102 version 3, as defined by RFC-1305, and versions 1
103 and 2, as defined by RFC-1059 and RFC-1119, respectively.
104
105 <p>The
106 <code>ntpd</code>
107 utility does most computations in 64-bit floating point
108 arithmetic and does relatively clumsy 64-bit fixed point operations
109 only when necessary to preserve the ultimate precision, about 232
110 picoseconds.
111 While the ultimate precision is not achievable with
112 ordinary workstations and networks of today, it may be required
113 with future gigahertz CPU clocks and gigabit LANs.
114
115 <p>Ordinarily,
116 <code>ntpd</code>
117 reads the
118 <code>ntp.conf(5)</code>
119 configuration file at startup time in order to determine the
120 synchronization sources and operating modes.
121 It is also possible to
122 specify a working, although limited, configuration entirely on the
123 command line, obviating the need for a configuration file.
124 This may
125 be particularly useful when the local host is to be configured as a
126 broadcast/multicast client, with all peers being determined by
127 listening to broadcasts at run time.
128
129 <p>If NetInfo support is built into
130 <code>ntpd</code>
131 then
132 <code>ntpd</code>
133 will attempt to read its configuration from the
134 NetInfo if the default
135 <code>ntp.conf(5)</code>
136 file cannot be read and no file is
137 specified by the
138 <code>-c</code>
139 option.
140
141 <p>Various internal
142 <code>ntpd</code>
143 variables can be displayed and
144 configuration options altered while the
145 <code>ntpd</code>
146 is running
147 using the
148 <code>ntpq(1ntpqmdoc)</code>
149 and
150 <code>ntpdc(1ntpdcmdoc)</code>
151 utility programs.
152
153 <p>When
154 <code>ntpd</code>
155 starts it looks at the value of
156 <code>umask(2)</code>,
157 and if zero
158 <code>ntpd</code>
159 will set the
160 <code>umask(2)</code>
161 to 022.
162
163 <p>This section was generated by <strong>AutoGen</strong>,
164 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpd</code> program.
165 This software is released under the NTP license, <http://ntp.org/license>.
166
167 <ul class="menu">
168 <li><a accesskey="1" href="#ntpd-usage">ntpd usage</a>: ntpd help/usage (<samp><span class="option">--help</span></samp>)
169 <li><a accesskey="2" href="#ntpd-ipv4">ntpd ipv4</a>: ipv4 option (-4)
170 <li><a accesskey="3" href="#ntpd-ipv6">ntpd ipv6</a>: ipv6 option (-6)
171 <li><a accesskey="4" href="#ntpd-authreq">ntpd authreq</a>: authreq option (-a)
172 <li><a accesskey="5" href="#ntpd-authnoreq">ntpd authnoreq</a>: authnoreq option (-A)
173 <li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>: configfile option (-c)
174 <li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>: driftfile option (-f)
175 <li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>: panicgate option (-g)
176 <li><a accesskey="9" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>: force-step-once option (-G)
177 <li><a href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i)
178 <li><a href="#ntpd-interface">ntpd interface</a>: interface option (-I)
179 <li><a href="#ntpd-keyfile">ntpd keyfile</a>: keyfile option (-k)
180 <li><a href="#ntpd-logfile">ntpd logfile</a>: logfile option (-l)
181 <li><a href="#ntpd-novirtualips">ntpd novirtualips</a>: novirtualips option (-L)
182 <li><a href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>: modifymmtimer option (-M)
183 <li><a href="#ntpd-nice">ntpd nice</a>: nice option (-N)
184 <li><a href="#ntpd-pidfile">ntpd pidfile</a>: pidfile option (-p)
185 <li><a href="#ntpd-priority">ntpd priority</a>: priority option (-P)
186 <li><a href="#ntpd-quit">ntpd quit</a>: quit option (-q)
187 <li><a href="#ntpd-propagationdelay">ntpd propagationdelay</a>: propagationdelay option (-r)
188 <li><a href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>: saveconfigquit option
189 <li><a href="#ntpd-statsdir">ntpd statsdir</a>: statsdir option (-s)
190 <li><a href="#ntpd-trustedkey">ntpd trustedkey</a>: trustedkey option (-t)
191 <li><a href="#ntpd-user">ntpd user</a>: user option (-u)
192 <li><a href="#ntpd-updateinterval">ntpd updateinterval</a>: updateinterval option (-U)
193 <li><a href="#ntpd-wait_002dsync">ntpd wait-sync</a>: wait-sync option (-w)
194 <li><a href="#ntpd-slew">ntpd slew</a>: slew option (-x)
195 <li><a href="#ntpd-usepcc">ntpd usepcc</a>: usepcc option
196 <li><a href="#ntpd-pccfreq">ntpd pccfreq</a>: pccfreq option
197 <li><a href="#ntpd-mdns">ntpd mdns</a>: mdns option (-m)
198 <li><a href="#ntpd-config">ntpd config</a>: presetting/configuring ntpd
199 <li><a href="#ntpd-exit-status">ntpd exit status</a>: exit status
200 <li><a href="#ntpd-Usage">ntpd Usage</a>: Usage
201 <li><a href="#ntpd-Files">ntpd Files</a>: Files
202 <li><a href="#ntpd-See-Also">ntpd See Also</a>: See Also
203 <li><a href="#ntpd-Bugs">ntpd Bugs</a>: Bugs
204 <li><a href="#ntpd-Notes">ntpd Notes</a>: Notes
205 </ul>
206
207 <div class="node">
208 <p><hr>
209 <a name="ntpd-usage"></a>
210 Next: <a rel="next" accesskey="n" href="#ntpd-ipv4">ntpd ipv4</a>,
211 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
212
213 </div>
214
215 <h4 class="subsection">ntpd help/usage (<samp><span class="option">--help</span></samp>)</h4>
216
217 <p><a name="index-ntpd-help-3"></a>
218 This is the automatically generated usage text for ntpd.
219
220 <p>The text printed is the same whether selected with the <code>help</code> option
221 (<samp><span class="option">--help</span></samp>) or the <code>more-help</code> option (<samp><span class="option">--more-help</span></samp>). <code>more-help</code> will print
222 the usage text by passing it through a pager program.
223 <code>more-help</code> is disabled on platforms without a working
224 <code>fork(2)</code> function. The <code>PAGER</code> environment variable is
225 used to select the program, defaulting to <samp><span class="file">more</span></samp>. Both will exit
226 with a status code of 0.
227
228 <pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p4
229 Usage: ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
230 [ <server1> ... <serverN> ]
231 Flg Arg Option-Name Description
232 -4 no ipv4 Force IPv4 DNS name resolution
233 - prohibits the option 'ipv6'
234 -6 no ipv6 Force IPv6 DNS name resolution
235 - prohibits the option 'ipv4'
236 -a no authreq Require crypto authentication
237 - prohibits the option 'authnoreq'
238 -A no authnoreq Do not require crypto authentication
239 - prohibits the option 'authreq'
240 -b no bcastsync Allow us to sync to broadcast servers
241 -c Str configfile configuration file name
242 -d no debug-level Increase debug verbosity level
243 - may appear multiple times
244 -D Num set-debug-level Set the debug verbosity level
245 - may appear multiple times
246 -f Str driftfile frequency drift file name
247 -g no panicgate Allow the first adjustment to be Big
248 - may appear multiple times
249 -G no force-step-once Step any initial offset correction.
250 -i Str jaildir Jail directory
251 -I Str interface Listen on an interface name or address
252 - may appear multiple times
253 -k Str keyfile path to symmetric keys
254 -l Str logfile path to the log file
255 -L no novirtualips Do not listen to virtual interfaces
256 -n no nofork Do not fork
257 - prohibits the option 'wait-sync'
258 -N no nice Run at high priority
259 -p Str pidfile path to the PID file
260 -P Num priority Process priority
261 -q no quit Set the time and quit
262 - prohibits these options:
263 saveconfigquit
264 wait-sync
265 -r Str propagationdelay Broadcast/propagation delay
266 Str saveconfigquit Save parsed configuration and quit
267 - prohibits these options:
268 quit
269 wait-sync
270 -s Str statsdir Statistics file location
271 -t Str trustedkey Trusted key number
272 - may appear multiple times
273 -u Str user Run as userid (or userid:groupid)
274 -U Num updateinterval interval in seconds between scans for new or dropped interfaces
275 Str var make ARG an ntp variable (RW)
276 - may appear multiple times
277 Str dvar make ARG an ntp variable (RW|DEF)
278 - may appear multiple times
279 -w Num wait-sync Seconds to wait for first clock sync
280 - prohibits these options:
281 nofork
282 quit
283 saveconfigquit
284 -x no slew Slew up to 600 seconds
285 opt version output version information and exit
286 -? no help display extended usage information and exit
287 -! no more-help extended usage information passed thru pager
288
289 Options are specified by doubled hyphens and their name or by a single
290 hyphen and the flag character.
291
292
293 The following option preset mechanisms are supported:
294 - examining environment variables named NTPD_*
295
296 Please send bug reports to: <http://bugs.ntp.org, bugs (a] ntp.org>
297 </pre>
298 <div class="node">
299 <p><hr>
300 <a name="ntpd-ipv4"></a>
301 Next: <a rel="next" accesskey="n" href="#ntpd-ipv6">ntpd ipv6</a>,
302 Previous: <a rel="previous" accesskey="p" href="#ntpd-usage">ntpd usage</a>,
303 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
304
305 </div>
306
307 <h4 class="subsection">ipv4 option (-4)</h4>
308
309 <p><a name="index-ntpd_002dipv4-4"></a>
310 This is the “force ipv4 dns name resolution” option.
311
312 <p class="noindent">This option has some usage constraints. It:
313 <ul>
314 <li>must not appear in combination with any of the following options:
315 ipv6.
316 </ul>
317
318 <p>Force DNS resolution of following host names on the command line
319 to the IPv4 namespace.
320 <div class="node">
321 <p><hr>
322 <a name="ntpd-ipv6"></a>
323 Next: <a rel="next" accesskey="n" href="#ntpd-authreq">ntpd authreq</a>,
324 Previous: <a rel="previous" accesskey="p" href="#ntpd-ipv4">ntpd ipv4</a>,
325 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
326
327 </div>
328
329 <h4 class="subsection">ipv6 option (-6)</h4>
330
331 <p><a name="index-ntpd_002dipv6-5"></a>
332 This is the “force ipv6 dns name resolution” option.
333
334 <p class="noindent">This option has some usage constraints. It:
335 <ul>
336 <li>must not appear in combination with any of the following options:
337 ipv4.
338 </ul>
339
340 <p>Force DNS resolution of following host names on the command line
341 to the IPv6 namespace.
342 <div class="node">
343 <p><hr>
344 <a name="ntpd-authreq"></a>
345 Next: <a rel="next" accesskey="n" href="#ntpd-authnoreq">ntpd authnoreq</a>,
346 Previous: <a rel="previous" accesskey="p" href="#ntpd-ipv6">ntpd ipv6</a>,
347 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
348
349 </div>
350
351 <h4 class="subsection">authreq option (-a)</h4>
352
353 <p><a name="index-ntpd_002dauthreq-6"></a>
354 This is the “require crypto authentication” option.
355
356 <p class="noindent">This option has some usage constraints. It:
357 <ul>
358 <li>must not appear in combination with any of the following options:
359 authnoreq.
360 </ul>
361
362 <p>Require cryptographic authentication for broadcast client,
363 multicast client and symmetric passive associations.
364 This is the default.
365 <div class="node">
366 <p><hr>
367 <a name="ntpd-authnoreq"></a>
368 Next: <a rel="next" accesskey="n" href="#ntpd-configfile">ntpd configfile</a>,
369 Previous: <a rel="previous" accesskey="p" href="#ntpd-authreq">ntpd authreq</a>,
370 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
371
372 </div>
373
374 <h4 class="subsection">authnoreq option (-A)</h4>
375
376 <p><a name="index-ntpd_002dauthnoreq-7"></a>
377 This is the “do not require crypto authentication” option.
378
379 <p class="noindent">This option has some usage constraints. It:
380 <ul>
381 <li>must not appear in combination with any of the following options:
382 authreq.
383 </ul>
384
385 <p>Do not require cryptographic authentication for broadcast client,
386 multicast client and symmetric passive associations.
387 This is almost never a good idea.
388 <div class="node">
389 <p><hr>
390 <a name="ntpd-configfile"></a>
391 Next: <a rel="next" accesskey="n" href="#ntpd-driftfile">ntpd driftfile</a>,
392 Previous: <a rel="previous" accesskey="p" href="#ntpd-authnoreq">ntpd authnoreq</a>,
393 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
394
395 </div>
396
397 <h4 class="subsection">configfile option (-c)</h4>
398
399 <p><a name="index-ntpd_002dconfigfile-8"></a>
400 This is the “configuration file name” option.
401 This option takes a string argument.
402 The name and path of the configuration file,
403 <samp><span class="file">/etc/ntp.conf</span></samp>
404 by default.
405 <div class="node">
406 <p><hr>
407 <a name="ntpd-driftfile"></a>
408 Next: <a rel="next" accesskey="n" href="#ntpd-panicgate">ntpd panicgate</a>,
409 Previous: <a rel="previous" accesskey="p" href="#ntpd-configfile">ntpd configfile</a>,
410 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
411
412 </div>
413
414 <h4 class="subsection">driftfile option (-f)</h4>
415
416 <p><a name="index-ntpd_002ddriftfile-9"></a>
417 This is the “frequency drift file name” option.
418 This option takes a string argument.
419 The name and path of the frequency file,
420 <samp><span class="file">/etc/ntp.drift</span></samp>
421 by default.
422 This is the same operation as the
423 <code>driftfile</code> <kbd>driftfile</kbd>
424 configuration specification in the
425 <samp><span class="file">/etc/ntp.conf</span></samp>
426 file.
427 <div class="node">
428 <p><hr>
429 <a name="ntpd-panicgate"></a>
430 Next: <a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
431 Previous: <a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
432 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
433
434 </div>
435
436 <h4 class="subsection">panicgate option (-g)</h4>
437
438 <p><a name="index-ntpd_002dpanicgate-10"></a>
439 This is the “allow the first adjustment to be big” option.
440
441 <p class="noindent">This option has some usage constraints. It:
442 <ul>
443 <li>may appear an unlimited number of times.
444 </ul>
445
446 <p>Normally,
447 <code>ntpd</code>
448 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,
449 <code>ntpd</code>
450 will exit with a message to the system log. This option can be used with the
451 <code>-q</code>
452 and
453 <code>-x</code>
454 options.
455 See the
456 <code>tinker</code>
457 configuration file directive for other options.
458 <div class="node">
459 <p><hr>
460 <a name="ntpd-force-step-once"></a>
461 <a name="ntpd-force_002dstep_002donce"></a>
462 Next: <a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
463 Previous: <a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
464 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
465
466 </div>
467
468 <h4 class="subsection">force-step-once option (-G)</h4>
469
470 <p><a name="index-ntpd_002dforce_002dstep_002donce-11"></a>
471 This is the “step any initial offset correction.” option.
472 Normally,
473 <code>ntpd</code>
474 steps the time if the time offset exceeds the step threshold,
475 which is 128 ms by default, and otherwise slews the time.
476 This option forces the initial offset correction to be stepped,
477 so the highest time accuracy can be achieved quickly.
478 However, this may also cause the time to be stepped back
479 so this option must not be used if
480 applications requiring monotonic time are running.
481 See the <code>tinker</code> configuration file directive for other options.
482 <div class="node">
483 <p><hr>
484 <a name="ntpd-jaildir"></a>
485 Next: <a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
486 Previous: <a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
487 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
488
489 </div>
490
491 <h4 class="subsection">jaildir option (-i)</h4>
492
493 <p><a name="index-ntpd_002djaildir-12"></a>
494 This is the “jail directory” option.
495 This option takes a string argument.
496
497 <p class="noindent">This option has some usage constraints. It:
498 <ul>
499 <li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
500 </ul>
501
502 <p>Chroot the server to the directory
503 <kbd>jaildir</kbd>
504 .
505 This option also implies that the server attempts to drop root privileges at startup.
506 You may need to also specify a
507 <code>-u</code>
508 option.
509 This option is only available if the OS supports adjusting the clock
510 without full root privileges.
511 This option is supported under NetBSD (configure with
512 <code>--enable-clockctl</code>) or Linux (configure with
513 <code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
514 <div class="node">
515 <p><hr>
516 <a name="ntpd-interface"></a>
517 Next: <a rel="next" accesskey="n" href="#ntpd-keyfile">ntpd keyfile</a>,
518 Previous: <a rel="previous" accesskey="p" href="#ntpd-jaildir">ntpd jaildir</a>,
519 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
520
521 </div>
522
523 <h4 class="subsection">interface option (-I)</h4>
524
525 <p><a name="index-ntpd_002dinterface-13"></a>
526 This is the “listen on an interface name or address” option.
527 This option takes a string argument <samp><span class="file">iface</span></samp>.
528
529 <p class="noindent">This option has some usage constraints. It:
530 <ul>
531 <li>may appear an unlimited number of times.
532 </ul>
533
534 <p>Open the network address given, or all the addresses associated with the
535 given interface name. This option may appear multiple times. This option
536 also implies not opening other addresses, except wildcard and localhost.
537 This option is deprecated. Please consider using the configuration file
538 <code>interface</code> command, which is more versatile.
539 <div class="node">
540 <p><hr>
541 <a name="ntpd-keyfile"></a>
542 Next: <a rel="next" accesskey="n" href="#ntpd-logfile">ntpd logfile</a>,
543 Previous: <a rel="previous" accesskey="p" href="#ntpd-interface">ntpd interface</a>,
544 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
545
546 </div>
547
548 <h4 class="subsection">keyfile option (-k)</h4>
549
550 <p><a name="index-ntpd_002dkeyfile-14"></a>
551 This is the “path to symmetric keys” option.
552 This option takes a string argument.
553 Specify the name and path of the symmetric key file.
554 <samp><span class="file">/etc/ntp.keys</span></samp>
555 is the default.
556 This is the same operation as the
557 <code>keys</code> <kbd>keyfile</kbd>
558 configuration file directive.
559 <div class="node">
560 <p><hr>
561 <a name="ntpd-logfile"></a>
562 Next: <a rel="next" accesskey="n" href="#ntpd-novirtualips">ntpd novirtualips</a>,
563 Previous: <a rel="previous" accesskey="p" href="#ntpd-keyfile">ntpd keyfile</a>,
564 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
565
566 </div>
567
568 <h4 class="subsection">logfile option (-l)</h4>
569
570 <p><a name="index-ntpd_002dlogfile-15"></a>
571 This is the “path to the log file” option.
572 This option takes a string argument.
573 Specify the name and path of the log file.
574 The default is the system log file.
575 This is the same operation as the
576 <code>logfile</code> <kbd>logfile</kbd>
577 configuration file directive.
578 <div class="node">
579 <p><hr>
580 <a name="ntpd-novirtualips"></a>
581 Next: <a rel="next" accesskey="n" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
582 Previous: <a rel="previous" accesskey="p" href="#ntpd-logfile">ntpd logfile</a>,
583 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
584
585 </div>
586
587 <h4 class="subsection">novirtualips option (-L)</h4>
588
589 <p><a name="index-ntpd_002dnovirtualips-16"></a>
590 This is the “do not listen to virtual interfaces” option.
591 Do not listen to virtual interfaces, defined as those with
592 names containing a colon. This option is deprecated. Please
593 consider using the configuration file <code>interface</code> command, which
594 is more versatile.
595 <div class="node">
596 <p><hr>
597 <a name="ntpd-modifymmtimer"></a>
598 Next: <a rel="next" accesskey="n" href="#ntpd-nice">ntpd nice</a>,
599 Previous: <a rel="previous" accesskey="p" href="#ntpd-novirtualips">ntpd novirtualips</a>,
600 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
601
602 </div>
603
604 <h4 class="subsection">modifymmtimer option (-M)</h4>
605
606 <p><a name="index-ntpd_002dmodifymmtimer-17"></a>
607 This is the “modify multimedia timer (windows only)” option.
608
609 <p class="noindent">This option has some usage constraints. It:
610 <ul>
611 <li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
612 </ul>
613
614 <p>Set the Windows Multimedia Timer to highest resolution. This
615 ensures the resolution does not change while ntpd is running,
616 avoiding timekeeping glitches associated with changes.
617 <div class="node">
618 <p><hr>
619 <a name="ntpd-nice"></a>
620 Next: <a rel="next" accesskey="n" href="#ntpd-pidfile">ntpd pidfile</a>,
621 Previous: <a rel="previous" accesskey="p" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
622 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
623
624 </div>
625
626 <h4 class="subsection">nice option (-N)</h4>
627
628 <p><a name="index-ntpd_002dnice-18"></a>
629 This is the “run at high priority” option.
630 To the extent permitted by the operating system, run
631 <code>ntpd</code>
632 at the highest priority.
633 <div class="node">
634 <p><hr>
635 <a name="ntpd-pidfile"></a>
636 Next: <a rel="next" accesskey="n" href="#ntpd-priority">ntpd priority</a>,
637 Previous: <a rel="previous" accesskey="p" href="#ntpd-nice">ntpd nice</a>,
638 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
639
640 </div>
641
642 <h4 class="subsection">pidfile option (-p)</h4>
643
644 <p><a name="index-ntpd_002dpidfile-19"></a>
645 This is the “path to the pid file” option.
646 This option takes a string argument.
647 Specify the name and path of the file used to record
648 <code>ntpd</code>'s
649 process ID.
650 This is the same operation as the
651 <code>pidfile</code> <kbd>pidfile</kbd>
652 configuration file directive.
653 <div class="node">
654 <p><hr>
655 <a name="ntpd-priority"></a>
656 Next: <a rel="next" accesskey="n" href="#ntpd-quit">ntpd quit</a>,
657 Previous: <a rel="previous" accesskey="p" href="#ntpd-pidfile">ntpd pidfile</a>,
658 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
659
660 </div>
661
662 <h4 class="subsection">priority option (-P)</h4>
663
664 <p><a name="index-ntpd_002dpriority-20"></a>
665 This is the “process priority” option.
666 This option takes a number argument.
667 To the extent permitted by the operating system, run
668 <code>ntpd</code>
669 at the specified
670 <code>sched_setscheduler(SCHED_FIFO)</code>
671 priority.
672 <div class="node">
673 <p><hr>
674 <a name="ntpd-quit"></a>
675 Next: <a rel="next" accesskey="n" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
676 Previous: <a rel="previous" accesskey="p" href="#ntpd-priority">ntpd priority</a>,
677 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
678
679 </div>
680
681 <h4 class="subsection">quit option (-q)</h4>
682
683 <p><a name="index-ntpd_002dquit-21"></a>
684 This is the “set the time and quit” option.
685
686 <p class="noindent">This option has some usage constraints. It:
687 <ul>
688 <li>must not appear in combination with any of the following options:
689 saveconfigquit, wait-sync.
690 </ul>
691
692 <p><code>ntpd</code>
693 will not daemonize and will exit after the clock is first
694 synchronized. This behavior mimics that of the
695 <code>ntpdate</code>
696 program, which will soon be replaced with a shell script.
697 The
698 <code>-g</code>
699 and
700 <code>-x</code>
701 options can be used with this option.
702 Note: The kernel time discipline is disabled with this option.
703 <div class="node">
704 <p><hr>
705 <a name="ntpd-propagationdelay"></a>
706 Next: <a rel="next" accesskey="n" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
707 Previous: <a rel="previous" accesskey="p" href="#ntpd-quit">ntpd quit</a>,
708 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
709
710 </div>
711
712 <h4 class="subsection">propagationdelay option (-r)</h4>
713
714 <p><a name="index-ntpd_002dpropagationdelay-22"></a>
715 This is the “broadcast/propagation delay” option.
716 This option takes a string argument.
717 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.
718 <div class="node">
719 <p><hr>
720 <a name="ntpd-saveconfigquit"></a>
721 Next: <a rel="next" accesskey="n" href="#ntpd-statsdir">ntpd statsdir</a>,
722 Previous: <a rel="previous" accesskey="p" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
723 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
724
725 </div>
726
727 <h4 class="subsection">saveconfigquit option</h4>
728
729 <p><a name="index-ntpd_002dsaveconfigquit-23"></a>
730 This is the “save parsed configuration and quit” option.
731 This option takes a string argument.
732
733 <p class="noindent">This option has some usage constraints. It:
734 <ul>
735 <li>must be compiled in by defining <code>SAVECONFIG</code> during the compilation.
736 <li>must not appear in combination with any of the following options:
737 quit, wait-sync.
738 </ul>
739
740 <p>Cause <code>ntpd</code> to parse its startup configuration file and save an
741 equivalent to the given filename and exit. This option was
742 designed for automated testing.
743 <div class="node">
744 <p><hr>
745 <a name="ntpd-statsdir"></a>
746 Next: <a rel="next" accesskey="n" href="#ntpd-trustedkey">ntpd trustedkey</a>,
747 Previous: <a rel="previous" accesskey="p" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
748 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
749
750 </div>
751
752 <h4 class="subsection">statsdir option (-s)</h4>
753
754 <p><a name="index-ntpd_002dstatsdir-24"></a>
755 This is the “statistics file location” option.
756 This option takes a string argument.
757 Specify the directory path for files created by the statistics facility.
758 This is the same operation as the
759 <code>statsdir</code> <kbd>statsdir</kbd>
760 configuration file directive.
761 <div class="node">
762 <p><hr>
763 <a name="ntpd-trustedkey"></a>
764 Next: <a rel="next" accesskey="n" href="#ntpd-user">ntpd user</a>,
765 Previous: <a rel="previous" accesskey="p" href="#ntpd-statsdir">ntpd statsdir</a>,
766 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
767
768 </div>
769
770 <h4 class="subsection">trustedkey option (-t)</h4>
771
772 <p><a name="index-ntpd_002dtrustedkey-25"></a>
773 This is the “trusted key number” option.
774 This option takes a string argument <samp><span class="file">tkey</span></samp>.
775
776 <p class="noindent">This option has some usage constraints. It:
777 <ul>
778 <li>may appear an unlimited number of times.
779 </ul>
780
781 <p>Add the specified key number to the trusted key list.
782 <div class="node">
783 <p><hr>
784 <a name="ntpd-user"></a>
785 Next: <a rel="next" accesskey="n" href="#ntpd-updateinterval">ntpd updateinterval</a>,
786 Previous: <a rel="previous" accesskey="p" href="#ntpd-trustedkey">ntpd trustedkey</a>,
787 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
788
789 </div>
790
791 <h4 class="subsection">user option (-u)</h4>
792
793 <p><a name="index-ntpd_002duser-26"></a>
794 This is the “run as userid (or userid:groupid)” option.
795 This option takes a string argument.
796
797 <p class="noindent">This option has some usage constraints. It:
798 <ul>
799 <li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
800 </ul>
801
802 <p>Specify a user, and optionally a group, to switch to.
803 This option is only available if the OS supports adjusting the clock
804 without full root privileges.
805 This option is supported under NetBSD (configure with
806 <code>--enable-clockctl</code>) or Linux (configure with
807 <code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
808 <div class="node">
809 <p><hr>
810 <a name="ntpd-updateinterval"></a>
811 Next: <a rel="next" accesskey="n" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
812 Previous: <a rel="previous" accesskey="p" href="#ntpd-user">ntpd user</a>,
813 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
814
815 </div>
816
817 <h4 class="subsection">updateinterval option (-U)</h4>
818
819 <p><a name="index-ntpd_002dupdateinterval-27"></a>
820 This is the “interval in seconds between scans for new or dropped interfaces” option.
821 This option takes a number argument.
822 Give the time in seconds between two scans for new or dropped interfaces.
823 For systems with routing socket support the scans will be performed shortly after the interface change
824 has been detected by the system.
825 Use 0 to disable scanning. 60 seconds is the minimum time between scans.
826 <div class="node">
827 <p><hr>
828 <a name="ntpd-wait-sync"></a>
829 <a name="ntpd-wait_002dsync"></a>
830 Next: <a rel="next" accesskey="n" href="#ntpd-slew">ntpd slew</a>,
831 Previous: <a rel="previous" accesskey="p" href="#ntpd-updateinterval">ntpd updateinterval</a>,
832 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
833
834 </div>
835
836 <h4 class="subsection">wait-sync option (-w)</h4>
837
838 <p><a name="index-ntpd_002dwait_002dsync-28"></a>
839 This is the “seconds to wait for first clock sync” option.
840 This option takes a number argument.
841
842 <p class="noindent">This option has some usage constraints. It:
843 <ul>
844 <li>must be compiled in by defining <code>HAVE_WORKING_FORK</code> during the compilation.
845 <li>must not appear in combination with any of the following options:
846 nofork, quit, saveconfigquit.
847 </ul>
848
849 <p>If greater than zero, alters <code>ntpd</code>'s behavior when forking to
850 daemonize. Instead of exiting with status 0 immediately after
851 the fork, the parent waits up to the specified number of
852 seconds for the child to first synchronize the clock. The exit
853 status is zero (success) if the clock was synchronized,
854 otherwise it is <code>ETIMEDOUT</code>.
855 This provides the option for a script starting <code>ntpd</code> to easily
856 wait for the first set of the clock before proceeding.
857 <div class="node">
858 <p><hr>
859 <a name="ntpd-slew"></a>
860 Next: <a rel="next" accesskey="n" href="#ntpd-usepcc">ntpd usepcc</a>,
861 Previous: <a rel="previous" accesskey="p" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
862 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
863
864 </div>
865
866 <h4 class="subsection">slew option (-x)</h4>
867
868 <p><a name="index-ntpd_002dslew-29"></a>
869 This is the “slew up to 600 seconds” option.
870 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.
871 This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
872 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.
873 Thus, an adjustment as much as 600 s will take almost 14 days to complete.
874 This option can be used with the
875 <code>-g</code>
876 and
877 <code>-q</code>
878 options.
879 See the
880 <code>tinker</code>
881 configuration file directive for other options.
882 Note: The kernel time discipline is disabled with this option.
883 <div class="node">
884 <p><hr>
885 <a name="ntpd-usepcc"></a>
886 Next: <a rel="next" accesskey="n" href="#ntpd-pccfreq">ntpd pccfreq</a>,
887 Previous: <a rel="previous" accesskey="p" href="#ntpd-slew">ntpd slew</a>,
888 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
889
890 </div>
891
892 <h4 class="subsection">usepcc option</h4>
893
894 <p><a name="index-ntpd_002dusepcc-30"></a>
895 This is the “use cpu cycle counter (windows only)” option.
896
897 <p class="noindent">This option has some usage constraints. It:
898 <ul>
899 <li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
900 </ul>
901
902 <p>Attempt to substitute the CPU counter for <code>QueryPerformanceCounter</code>.
903 The CPU counter and <code>QueryPerformanceCounter</code> are compared, and if
904 they have the same frequency, the CPU counter (RDTSC on x86) is
905 used directly, saving the overhead of a system call.
906 <div class="node">
907 <p><hr>
908 <a name="ntpd-pccfreq"></a>
909 Next: <a rel="next" accesskey="n" href="#ntpd-mdns">ntpd mdns</a>,
910 Previous: <a rel="previous" accesskey="p" href="#ntpd-usepcc">ntpd usepcc</a>,
911 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
912
913 </div>
914
915 <h4 class="subsection">pccfreq option</h4>
916
917 <p><a name="index-ntpd_002dpccfreq-31"></a>
918 This is the “force cpu cycle counter use (windows only)” option.
919 This option takes a string argument.
920
921 <p class="noindent">This option has some usage constraints. It:
922 <ul>
923 <li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
924 </ul>
925
926 <p>Force substitution the CPU counter for <code>QueryPerformanceCounter</code>.
927 The CPU counter (RDTSC on x86) is used unconditionally with the
928 given frequency (in Hz).
929 <div class="node">
930 <p><hr>
931 <a name="ntpd-mdns"></a>
932 Next: <a rel="next" accesskey="n" href="#ntpd-config">ntpd config</a>,
933 Previous: <a rel="previous" accesskey="p" href="#ntpd-pccfreq">ntpd pccfreq</a>,
934 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
935
936 </div>
937
938 <h4 class="subsection">mdns option (-m)</h4>
939
940 <p><a name="index-ntpd_002dmdns-32"></a>
941 This is the “register with mdns as a ntp server” option.
942
943 <p class="noindent">This option has some usage constraints. It:
944 <ul>
945 <li>must be compiled in by defining <code>HAVE_DNSREGISTRATION</code> during the compilation.
946 </ul>
947
948 <p>Registers as an NTP server with the local mDNS server which allows
949 the server to be discovered via mDNS client lookup.
950
951 <div class="node">
952 <p><hr>
953 <a name="ntpd-config"></a>
954 Next: <a rel="next" accesskey="n" href="#ntpd-exit-status">ntpd exit status</a>,
955 Previous: <a rel="previous" accesskey="p" href="#ntpd-mdns">ntpd mdns</a>,
956 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
957
958 </div>
959
960 <h4 class="subsection">presetting/configuring ntpd</h4>
961
962 <p>Any option that is not marked as <i>not presettable</i> may be preset by
963 loading values from environment variables named <code>NTPD</code> and <code>NTPD_<OPTION_NAME></code>. <code><OPTION_NAME></code> must be one of
964 the options listed above in upper case and segmented with underscores.
965 The <code>NTPD</code> variable will be tokenized and parsed like
966 the command line. The remaining variables are tested for existence and their
967 values are treated like option arguments.
968
969 <p>The command line options relating to configuration and/or usage help are:
970
971 <h5 class="subsubheading">version (-)</h5>
972
973 <p>Print the program version to standard out, optionally with licensing
974 information, then exit 0. The optional argument specifies how much licensing
975 detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
976 Only the first letter of the argument is examined:
977
978 <dl>
979 <dt>`<samp><span class="samp">version</span></samp>'<dd>Only print the version. This is the default.
980 <br><dt>`<samp><span class="samp">copyright</span></samp>'<dd>Name the copyright usage licensing terms.
981 <br><dt>`<samp><span class="samp">verbose</span></samp>'<dd>Print the full copyright usage licensing terms.
982 </dl>
983
984 <div class="node">
985 <p><hr>
986 <a name="ntpd-exit-status"></a>
987 Next: <a rel="next" accesskey="n" href="#ntpd-Usage">ntpd Usage</a>,
988 Previous: <a rel="previous" accesskey="p" href="#ntpd-config">ntpd config</a>,
989 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
990
991 </div>
992
993 <h4 class="subsection">ntpd exit status</h4>
994
995 <p>One of the following exit values will be returned:
996 <dl>
997 <dt>`<samp><span class="samp">0 (EXIT_SUCCESS)</span></samp>'<dd>Successful program execution.
998 <br><dt>`<samp><span class="samp">1 (EXIT_FAILURE)</span></samp>'<dd>The operation failed or the command syntax was not valid.
999 </dl>
1000 <div class="node">
1001 <p><hr>
1002 <a name="ntpd-Usage"></a>
1003 Next: <a rel="next" accesskey="n" href="#ntpd-Files">ntpd Files</a>,
1004 Previous: <a rel="previous" accesskey="p" href="#ntpd-exit-status">ntpd exit status</a>,
1005 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1006
1007 </div>
1008
1009 <h4 class="subsection">ntpd Usage</h4>
1010
1011 <div class="node">
1012 <p><hr>
1013 <a name="ntpd-Files"></a>
1014 Next: <a rel="next" accesskey="n" href="#ntpd-See-Also">ntpd See Also</a>,
1015 Previous: <a rel="previous" accesskey="p" href="#ntpd-Usage">ntpd Usage</a>,
1016 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1017
1018 </div>
1019
1020 <h4 class="subsection">ntpd Files</h4>
1021
1022 <div class="node">
1023 <p><hr>
1024 <a name="ntpd-See-Also"></a>
1025 Next: <a rel="next" accesskey="n" href="#ntpd-Bugs">ntpd Bugs</a>,
1026 Previous: <a rel="previous" accesskey="p" href="#ntpd-Files">ntpd Files</a>,
1027 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1028
1029 </div>
1030
1031 <h4 class="subsection">ntpd See Also</h4>
1032
1033 <div class="node">
1034 <p><hr>
1035 <a name="ntpd-Bugs"></a>
1036 Next: <a rel="next" accesskey="n" href="#ntpd-Notes">ntpd Notes</a>,
1037 Previous: <a rel="previous" accesskey="p" href="#ntpd-See-Also">ntpd See Also</a>,
1038 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1039
1040 </div>
1041
1042 <h4 class="subsection">ntpd Bugs</h4>
1043
1044 <div class="node">
1045 <p><hr>
1046 <a name="ntpd-Notes"></a>
1047 Previous: <a rel="previous" accesskey="p" href="#ntpd-Bugs">ntpd Bugs</a>,
1048 Up: <a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1049
1050 </div>
1051
1052 <h4 class="subsection">ntpd Notes</h4>
1053
1054 <div class="node">
1055 <p><hr>
1056 <a name="Usage"></a>
1057
1058
1059 </div>
1060
1061 <!-- node-name, next, previous, up -->
1062 <h3 class="section">Usage</h3>
1063
1064