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>
27Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Description">ntpd Description</a>,
28Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
29Up:&nbsp;<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
36system clock to remote NTP time servers or local reference clocks. 
37It is a complete implementation of NTP version 4 defined by RFC-5905, but
38also retains compatible with version 3 defined by RFC-1305 and versions
391 and 2, defined by RFC-1059 and RFC-1119, respectively. 
40The program can operate in any of several modes, including client/server,
41symmetric and broadcast modes, and with both symmetric-key and public-key
42cryptography.
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
63a configuration file described at <a href="#ntp_002econf">ntp.conf</a>. 
64This configuration file contains configuration commands described on
65the pages listed above. 
66However a client can discover remote servers and configure them
67automatically. 
68This makes it possible to deploy a fleet of workstations without
69specifying configuration details specific to the local environment.
70
71  <p>The <code>ntpd</code> program normally operates continuously while adjusting the
72system time and frequency, but in some cases this might not be
73practical. 
74With the <code>-q</code> option <code>ntpd</code> operates as in continuous mode, but
75exits just after setting the clock for the first time. 
76Most applications will probably want to specify the <code>iburst</code>
77option with the <code>server</code> command. 
78With this option an initial volley of messages is exchanged to
79groom the data and set the clock in about ten seconds' time. 
80If nothing is heard after a few minutes' time,
81the 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>
96utility is an operating system daemon which sets
97and maintains the system time of day in synchronism with Internet
98standard time servers. 
99It is a complete implementation of the
100Network Time Protocol (NTP) version 4, as defined by RFC-5905,
101but also retains compatibility with
102version 3, as defined by RFC-1305, and versions 1
103and 2, as defined by RFC-1059 and RFC-1119, respectively.
104
105  <p>The
106<code>ntpd</code>
107utility does most computations in 64-bit floating point
108arithmetic and does relatively clumsy 64-bit fixed point operations
109only when necessary to preserve the ultimate precision, about 232
110picoseconds. 
111While the ultimate precision is not achievable with
112ordinary workstations and networks of today, it may be required
113with future gigahertz CPU clocks and gigabit LANs.
114
115  <p>Ordinarily,
116<code>ntpd</code>
117reads the
118<code>ntp.conf(5)</code>
119configuration file at startup time in order to determine the
120synchronization sources and operating modes. 
121It is also possible to
122specify a working, although limited, configuration entirely on the
123command line, obviating the need for a configuration file. 
124This may
125be particularly useful when the local host is to be configured as a
126broadcast/multicast client, with all peers being determined by
127listening to broadcasts at run time.
128
129  <p>If NetInfo support is built into
130<code>ntpd</code>
131then
132<code>ntpd</code>
133will attempt to read its configuration from the
134NetInfo if the default
135<code>ntp.conf(5)</code>
136file cannot be read and no file is
137specified by the
138<code>-c</code>
139option.
140
141  <p>Various internal
142<code>ntpd</code>
143variables can be displayed and
144configuration options altered while the
145<code>ntpd</code>
146is running
147using the
148<code>ntpq(1ntpqmdoc)</code>
149and
150<code>ntpdc(1ntpdcmdoc)</code>
151utility programs.
152
153  <p>When
154<code>ntpd</code>
155starts it looks at the value of
156<code>umask(2)</code>,
157and if zero
158<code>ntpd</code>
159will set the
160<code>umask(2)</code>
161to 022.
162
163  <p>This section was generated by <strong>AutoGen</strong>,
164using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpd</code> program. 
165This software is released under the NTP license, &lt;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>
210Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv4">ntpd ipv4</a>,
211Up:&nbsp;<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>
218This 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
222the 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
225used to select the program, defaulting to <samp><span class="file">more</span></samp>.  Both will exit
226with a status code of 0.
227
228<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p4
229Usage:  ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
230                [ &lt;server1&gt; ... &lt;serverN&gt; ]
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
289Options are specified by doubled hyphens and their name or by a single
290hyphen and the flag character.
291
292
293The following option preset mechanisms are supported:
294 - examining environment variables named NTPD_*
295
296Please send bug reports to:  &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
297</pre>
298  <div class="node">
299<p><hr>
300<a name="ntpd-ipv4"></a>
301Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv6">ntpd ipv6</a>,
302Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usage">ntpd usage</a>,
303Up:&nbsp;<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>
310This is the &ldquo;force ipv4 dns name resolution&rdquo; 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:
315ipv6. 
316</ul>
317
318  <p>Force DNS resolution of following host names on the command line
319to the IPv4 namespace. 
320<div class="node">
321<p><hr>
322<a name="ntpd-ipv6"></a>
323Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authreq">ntpd authreq</a>,
324Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv4">ntpd ipv4</a>,
325Up:&nbsp;<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>
332This is the &ldquo;force ipv6 dns name resolution&rdquo; 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:
337ipv4. 
338</ul>
339
340  <p>Force DNS resolution of following host names on the command line
341to the IPv6 namespace. 
342<div class="node">
343<p><hr>
344<a name="ntpd-authreq"></a>
345Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authnoreq">ntpd authnoreq</a>,
346Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv6">ntpd ipv6</a>,
347Up:&nbsp;<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>
354This is the &ldquo;require crypto authentication&rdquo; 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:
359authnoreq. 
360</ul>
361
362  <p>Require cryptographic authentication for broadcast client,
363multicast client and symmetric passive associations. 
364This is the default. 
365<div class="node">
366<p><hr>
367<a name="ntpd-authnoreq"></a>
368Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-configfile">ntpd configfile</a>,
369Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authreq">ntpd authreq</a>,
370Up:&nbsp;<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>
377This is the &ldquo;do not require crypto authentication&rdquo; 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:
382authreq. 
383</ul>
384
385  <p>Do not require cryptographic authentication for broadcast client,
386multicast client and symmetric passive associations. 
387This is almost never a good idea. 
388<div class="node">
389<p><hr>
390<a name="ntpd-configfile"></a>
391Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-driftfile">ntpd driftfile</a>,
392Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authnoreq">ntpd authnoreq</a>,
393Up:&nbsp;<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>
400This is the &ldquo;configuration file name&rdquo; option. 
401This option takes a string argument. 
402The name and path of the configuration file,
403<samp><span class="file">/etc/ntp.conf</span></samp>
404by default. 
405<div class="node">
406<p><hr>
407<a name="ntpd-driftfile"></a>
408Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-panicgate">ntpd panicgate</a>,
409Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-configfile">ntpd configfile</a>,
410Up:&nbsp;<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>
417This is the &ldquo;frequency drift file name&rdquo; option. 
418This option takes a string argument. 
419The name and path of the frequency file,
420<samp><span class="file">/etc/ntp.drift</span></samp>
421by default. 
422This is the same operation as the
423<code>driftfile</code> <kbd>driftfile</kbd>
424configuration specification in the
425<samp><span class="file">/etc/ntp.conf</span></samp>
426file. 
427<div class="node">
428<p><hr>
429<a name="ntpd-panicgate"></a>
430Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
431Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
432Up:&nbsp;<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>
439This is the &ldquo;allow the first adjustment to be big&rdquo; 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>
448exits 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>
450will exit with a message to the system log. This option can be used with the
451<code>-q</code>
452and
453<code>-x</code>
454options. 
455See the
456<code>tinker</code>
457configuration 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>
462Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
463Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
464Up:&nbsp;<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>
471This is the &ldquo;step any initial offset correction.&rdquo; option. 
472Normally,
473<code>ntpd</code>
474steps the time if the time offset exceeds the step threshold,
475which is 128 ms by default, and otherwise slews the time. 
476This option forces the initial offset correction to be stepped,
477so the highest time accuracy can be achieved quickly. 
478However, this may also cause the time to be stepped back
479so this option must not be used if
480applications requiring monotonic time are running. 
481See the <code>tinker</code> configuration file directive for other options. 
482<div class="node">
483<p><hr>
484<a name="ntpd-jaildir"></a>
485Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
486Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
487Up:&nbsp;<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>
494This is the &ldquo;jail directory&rdquo; option. 
495This 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. 
505This option also implies that the server attempts to drop root privileges at startup. 
506You may need to also specify a
507<code>-u</code>
508option. 
509This option is only available if the OS supports adjusting the clock
510without full root privileges. 
511This 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>
517Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-keyfile">ntpd keyfile</a>,
518Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-jaildir">ntpd jaildir</a>,
519Up:&nbsp;<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>
526This is the &ldquo;listen on an interface name or address&rdquo; option. 
527This 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
535given interface name.  This option may appear multiple times.  This option
536also implies not opening other addresses, except wildcard and localhost. 
537This 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>
542Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-logfile">ntpd logfile</a>,
543Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-interface">ntpd interface</a>,
544Up:&nbsp;<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>
551This is the &ldquo;path to symmetric keys&rdquo; option. 
552This option takes a string argument. 
553Specify the name and path of the symmetric key file. 
554<samp><span class="file">/etc/ntp.keys</span></samp>
555is the default. 
556This is the same operation as the
557<code>keys</code> <kbd>keyfile</kbd>
558configuration file directive. 
559<div class="node">
560<p><hr>
561<a name="ntpd-logfile"></a>
562Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-novirtualips">ntpd novirtualips</a>,
563Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-keyfile">ntpd keyfile</a>,
564Up:&nbsp;<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>
571This is the &ldquo;path to the log file&rdquo; option. 
572This option takes a string argument. 
573Specify the name and path of the log file. 
574The default is the system log file. 
575This is the same operation as the
576<code>logfile</code> <kbd>logfile</kbd>
577configuration file directive. 
578<div class="node">
579<p><hr>
580<a name="ntpd-novirtualips"></a>
581Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
582Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-logfile">ntpd logfile</a>,
583Up:&nbsp;<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>
590This is the &ldquo;do not listen to virtual interfaces&rdquo; option. 
591Do not listen to virtual interfaces, defined as those with
592names containing a colon.  This option is deprecated.  Please
593consider using the configuration file <code>interface</code> command, which
594is more versatile. 
595<div class="node">
596<p><hr>
597<a name="ntpd-modifymmtimer"></a>
598Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-nice">ntpd nice</a>,
599Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-novirtualips">ntpd novirtualips</a>,
600Up:&nbsp;<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>
607This is the &ldquo;modify multimedia timer (windows only)&rdquo; 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
615ensures the resolution does not change while ntpd is running,
616avoiding timekeeping glitches associated with changes. 
617<div class="node">
618<p><hr>
619<a name="ntpd-nice"></a>
620Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pidfile">ntpd pidfile</a>,
621Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
622Up:&nbsp;<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>
629This is the &ldquo;run at high priority&rdquo; option. 
630To the extent permitted by the operating system, run
631<code>ntpd</code>
632at the highest priority. 
633<div class="node">
634<p><hr>
635<a name="ntpd-pidfile"></a>
636Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-priority">ntpd priority</a>,
637Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-nice">ntpd nice</a>,
638Up:&nbsp;<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>
645This is the &ldquo;path to the pid file&rdquo; option. 
646This option takes a string argument. 
647Specify the name and path of the file used to record
648<code>ntpd</code>'s
649process ID. 
650This is the same operation as the
651<code>pidfile</code> <kbd>pidfile</kbd>
652configuration file directive. 
653<div class="node">
654<p><hr>
655<a name="ntpd-priority"></a>
656Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-quit">ntpd quit</a>,
657Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pidfile">ntpd pidfile</a>,
658Up:&nbsp;<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>
665This is the &ldquo;process priority&rdquo; option. 
666This option takes a number argument. 
667To the extent permitted by the operating system, run
668<code>ntpd</code>
669at the specified
670<code>sched_setscheduler(SCHED_FIFO)</code>
671priority. 
672<div class="node">
673<p><hr>
674<a name="ntpd-quit"></a>
675Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
676Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-priority">ntpd priority</a>,
677Up:&nbsp;<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>
684This is the &ldquo;set the time and quit&rdquo; 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:
689saveconfigquit, wait-sync. 
690</ul>
691
692  <p><code>ntpd</code>
693will not daemonize and will exit after the clock is first
694synchronized.  This behavior mimics that of the
695<code>ntpdate</code>
696program, which will soon be replaced with a shell script. 
697The
698<code>-g</code>
699and
700<code>-x</code>
701options can be used with this option. 
702Note: The kernel time discipline is disabled with this option. 
703<div class="node">
704<p><hr>
705<a name="ntpd-propagationdelay"></a>
706Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
707Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-quit">ntpd quit</a>,
708Up:&nbsp;<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>
715This is the &ldquo;broadcast/propagation delay&rdquo; option. 
716This option takes a string argument. 
717Specify 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>
721Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-statsdir">ntpd statsdir</a>,
722Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
723Up:&nbsp;<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>
730This is the &ldquo;save parsed configuration and quit&rdquo; option. 
731This 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:
737quit, wait-sync. 
738</ul>
739
740  <p>Cause <code>ntpd</code> to parse its startup configuration file and save an
741equivalent to the given filename and exit.  This option was
742designed for automated testing. 
743<div class="node">
744<p><hr>
745<a name="ntpd-statsdir"></a>
746Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-trustedkey">ntpd trustedkey</a>,
747Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
748Up:&nbsp;<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>
755This is the &ldquo;statistics file location&rdquo; option. 
756This option takes a string argument. 
757Specify the directory path for files created by the statistics facility. 
758This is the same operation as the
759<code>statsdir</code> <kbd>statsdir</kbd>
760configuration file directive. 
761<div class="node">
762<p><hr>
763<a name="ntpd-trustedkey"></a>
764Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-user">ntpd user</a>,
765Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-statsdir">ntpd statsdir</a>,
766Up:&nbsp;<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>
773This is the &ldquo;trusted key number&rdquo; option. 
774This 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>
785Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-updateinterval">ntpd updateinterval</a>,
786Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-trustedkey">ntpd trustedkey</a>,
787Up:&nbsp;<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>
794This is the &ldquo;run as userid (or userid:groupid)&rdquo; option. 
795This 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. 
803This option is only available if the OS supports adjusting the clock
804without full root privileges. 
805This 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>
811Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
812Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-user">ntpd user</a>,
813Up:&nbsp;<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>
820This is the &ldquo;interval in seconds between scans for new or dropped interfaces&rdquo; option. 
821This option takes a number argument. 
822Give the time in seconds between two scans for new or dropped interfaces. 
823For systems with routing socket support the scans will be performed shortly after the interface change
824has been detected by the system. 
825Use 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>
830Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-slew">ntpd slew</a>,
831Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-updateinterval">ntpd updateinterval</a>,
832Up:&nbsp;<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>
839This is the &ldquo;seconds to wait for first clock sync&rdquo; option. 
840This 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:
846nofork, quit, saveconfigquit. 
847</ul>
848
849  <p>If greater than zero, alters <code>ntpd</code>'s behavior when forking to
850daemonize.  Instead of exiting with status 0 immediately after
851the fork, the parent waits up to the specified number of
852seconds for the child to first synchronize the clock.  The exit
853status is zero (success) if the clock was synchronized,
854otherwise it is <code>ETIMEDOUT</code>. 
855This provides the option for a script starting <code>ntpd</code> to easily
856wait for the first set of the clock before proceeding. 
857<div class="node">
858<p><hr>
859<a name="ntpd-slew"></a>
860Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-usepcc">ntpd usepcc</a>,
861Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
862Up:&nbsp;<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>
869This is the &ldquo;slew up to 600 seconds&rdquo; option. 
870Normally, 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. 
871This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. 
872Note: 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. 
873Thus, an adjustment as much as 600 s will take almost 14 days to complete. 
874This option can be used with the
875<code>-g</code>
876and
877<code>-q</code>
878options. 
879See the
880<code>tinker</code>
881configuration file directive for other options. 
882Note: The kernel time discipline is disabled with this option. 
883<div class="node">
884<p><hr>
885<a name="ntpd-usepcc"></a>
886Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pccfreq">ntpd pccfreq</a>,
887Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-slew">ntpd slew</a>,
888Up:&nbsp;<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>
895This is the &ldquo;use cpu cycle counter (windows only)&rdquo; 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>. 
903The CPU counter and <code>QueryPerformanceCounter</code> are compared, and if
904they have the same frequency, the CPU counter (RDTSC on x86) is
905used directly, saving the overhead of a system call. 
906<div class="node">
907<p><hr>
908<a name="ntpd-pccfreq"></a>
909Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-mdns">ntpd mdns</a>,
910Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usepcc">ntpd usepcc</a>,
911Up:&nbsp;<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>
918This is the &ldquo;force cpu cycle counter use (windows only)&rdquo; option. 
919This 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>. 
927The CPU counter (RDTSC on x86) is used unconditionally with the
928given frequency (in Hz). 
929<div class="node">
930<p><hr>
931<a name="ntpd-mdns"></a>
932Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-config">ntpd config</a>,
933Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pccfreq">ntpd pccfreq</a>,
934Up:&nbsp;<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>
941This is the &ldquo;register with mdns as a ntp server&rdquo; 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
949the server to be discovered via mDNS client lookup.
950
951<div class="node">
952<p><hr>
953<a name="ntpd-config"></a>
954Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-exit-status">ntpd exit status</a>,
955Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-mdns">ntpd mdns</a>,
956Up:&nbsp;<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
963loading values from environment variables named <code>NTPD</code> and <code>NTPD_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
964the options listed above in upper case and segmented with underscores. 
965The <code>NTPD</code> variable will be tokenized and parsed like
966the command line.  The remaining variables are tested for existence and their
967values 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
974information, then exit 0.  The optional argument specifies how much licensing
975detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument. 
976Only 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>
987Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Usage">ntpd Usage</a>,
988Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-config">ntpd config</a>,
989Up:&nbsp;<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>
1003Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Files">ntpd Files</a>,
1004Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-exit-status">ntpd exit status</a>,
1005Up:&nbsp;<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>
1014Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-See-Also">ntpd See Also</a>,
1015Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Usage">ntpd Usage</a>,
1016Up:&nbsp;<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>
1025Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Bugs">ntpd Bugs</a>,
1026Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Files">ntpd Files</a>,
1027Up:&nbsp;<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>
1036Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Notes">ntpd Notes</a>,
1037Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-See-Also">ntpd See Also</a>,
1038Up:&nbsp;<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>
1047Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Bugs">ntpd Bugs</a>,
1048Up:&nbsp;<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