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