ntpd.html revision 280849
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.8p1 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.8p1-RC2
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</pre>
291  <div class="node">
292<p><hr>
293<a name="ntpd-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv6">ntpd ipv6</a>,
294Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usage">ntpd usage</a>,
295Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
296<br>
297</div>
298
299<h4 class="subsection">ipv4 option (-4)</h4>
300
301<p><a name="index-ntpd_002dipv4-4"></a>
302This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
303
304<p class="noindent">This option has some usage constraints.  It:
305     <ul>
306<li>must not appear in combination with any of the following options:
307ipv6. 
308</ul>
309
310  <p>Force DNS resolution of following host names on the command line
311to the IPv4 namespace. 
312<div class="node">
313<p><hr>
314<a name="ntpd-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authreq">ntpd authreq</a>,
315Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv4">ntpd ipv4</a>,
316Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
317<br>
318</div>
319
320<h4 class="subsection">ipv6 option (-6)</h4>
321
322<p><a name="index-ntpd_002dipv6-5"></a>
323This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
324
325<p class="noindent">This option has some usage constraints.  It:
326     <ul>
327<li>must not appear in combination with any of the following options:
328ipv4. 
329</ul>
330
331  <p>Force DNS resolution of following host names on the command line
332to the IPv6 namespace. 
333<div class="node">
334<p><hr>
335<a name="ntpd-authreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authnoreq">ntpd authnoreq</a>,
336Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv6">ntpd ipv6</a>,
337Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
338<br>
339</div>
340
341<h4 class="subsection">authreq option (-a)</h4>
342
343<p><a name="index-ntpd_002dauthreq-6"></a>
344This is the &ldquo;require crypto authentication&rdquo; option.
345
346<p class="noindent">This option has some usage constraints.  It:
347     <ul>
348<li>must not appear in combination with any of the following options:
349authnoreq. 
350</ul>
351
352  <p>Require cryptographic authentication for broadcast client,
353multicast client and symmetric passive associations. 
354This is the default. 
355<div class="node">
356<p><hr>
357<a name="ntpd-authnoreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-configfile">ntpd configfile</a>,
358Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authreq">ntpd authreq</a>,
359Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
360<br>
361</div>
362
363<h4 class="subsection">authnoreq option (-A)</h4>
364
365<p><a name="index-ntpd_002dauthnoreq-7"></a>
366This is the &ldquo;do not require crypto authentication&rdquo; option.
367
368<p class="noindent">This option has some usage constraints.  It:
369     <ul>
370<li>must not appear in combination with any of the following options:
371authreq. 
372</ul>
373
374  <p>Do not require cryptographic authentication for broadcast client,
375multicast client and symmetric passive associations. 
376This is almost never a good idea. 
377<div class="node">
378<p><hr>
379<a name="ntpd-configfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-driftfile">ntpd driftfile</a>,
380Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authnoreq">ntpd authnoreq</a>,
381Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
382<br>
383</div>
384
385<h4 class="subsection">configfile option (-c)</h4>
386
387<p><a name="index-ntpd_002dconfigfile-8"></a>
388This is the &ldquo;configuration file name&rdquo; option. 
389This option takes a string argument. 
390The name and path of the configuration file,
391<span class="file">/etc/ntp.conf</span>
392by default. 
393<div class="node">
394<p><hr>
395<a name="ntpd-driftfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-panicgate">ntpd panicgate</a>,
396Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-configfile">ntpd configfile</a>,
397Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
398<br>
399</div>
400
401<h4 class="subsection">driftfile option (-f)</h4>
402
403<p><a name="index-ntpd_002ddriftfile-9"></a>
404This is the &ldquo;frequency drift file name&rdquo; option. 
405This option takes a string argument. 
406The name and path of the frequency file,
407<span class="file">/etc/ntp.drift</span>
408by default. 
409This is the same operation as the
410<code>driftfile</code> <kbd>driftfile</kbd>
411configuration specification in the
412<span class="file">/etc/ntp.conf</span>
413file. 
414<div class="node">
415<p><hr>
416<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
417Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
418Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
419<br>
420</div>
421
422<h4 class="subsection">panicgate option (-g)</h4>
423
424<p><a name="index-ntpd_002dpanicgate-10"></a>
425This is the &ldquo;allow the first adjustment to be big&rdquo; option.
426
427<p class="noindent">This option has some usage constraints.  It:
428     <ul>
429<li>may appear an unlimited number of times. 
430</ul>
431
432  <p>Normally,
433<code>ntpd</code>
434exits 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,
435<code>ntpd</code>
436will exit with a message to the system log. This option can be used with the
437<code>-q</code>
438and
439<code>-x</code>
440options. 
441See the
442<code>tinker</code>
443configuration file directive for other options. 
444<div class="node">
445<p><hr>
446<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
447Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
448Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
449<br>
450</div>
451
452<h4 class="subsection">jaildir option (-i)</h4>
453
454<p><a name="index-ntpd_002djaildir-11"></a>
455This is the &ldquo;jail directory&rdquo; option. 
456This option takes a string argument.
457
458<p class="noindent">This option has some usage constraints.  It:
459     <ul>
460<li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation. 
461</ul>
462
463  <p>Chroot the server to the directory
464<kbd>jaildir</kbd>
465. 
466This option also implies that the server attempts to drop root privileges at startup. 
467You may need to also specify a
468<code>-u</code>
469option. 
470This option is only available if the OS supports adjusting the clock
471without full root privileges. 
472This option is supported under NetBSD (configure with
473<code>--enable-clockctl</code>) or Linux (configure with
474<code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>). 
475<div class="node">
476<p><hr>
477<a name="ntpd-interface"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-keyfile">ntpd keyfile</a>,
478Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-jaildir">ntpd jaildir</a>,
479Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
480<br>
481</div>
482
483<h4 class="subsection">interface option (-I)</h4>
484
485<p><a name="index-ntpd_002dinterface-12"></a>
486This is the &ldquo;listen on an interface name or address&rdquo; option. 
487This option takes a string argument <span class="file">iface</span>.
488
489<p class="noindent">This option has some usage constraints.  It:
490     <ul>
491<li>may appear an unlimited number of times. 
492</ul>
493
494  <p>Open the network address given, or all the addresses associated with the
495given interface name.  This option may appear multiple times.  This option
496also implies not opening other addresses, except wildcard and localhost. 
497This option is deprecated. Please consider using the configuration file
498<code>interface</code> command, which is more versatile. 
499<div class="node">
500<p><hr>
501<a name="ntpd-keyfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-logfile">ntpd logfile</a>,
502Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-interface">ntpd interface</a>,
503Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
504<br>
505</div>
506
507<h4 class="subsection">keyfile option (-k)</h4>
508
509<p><a name="index-ntpd_002dkeyfile-13"></a>
510This is the &ldquo;path to symmetric keys&rdquo; option. 
511This option takes a string argument. 
512Specify the name and path of the symmetric key file. 
513<span class="file">/etc/ntp.keys</span>
514is the default. 
515This is the same operation as the
516<code>keys</code> <kbd>keyfile</kbd>
517configuration file directive. 
518<div class="node">
519<p><hr>
520<a name="ntpd-logfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-novirtualips">ntpd novirtualips</a>,
521Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-keyfile">ntpd keyfile</a>,
522Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
523<br>
524</div>
525
526<h4 class="subsection">logfile option (-l)</h4>
527
528<p><a name="index-ntpd_002dlogfile-14"></a>
529This is the &ldquo;path to the log file&rdquo; option. 
530This option takes a string argument. 
531Specify the name and path of the log file. 
532The default is the system log file. 
533This is the same operation as the
534<code>logfile</code> <kbd>logfile</kbd>
535configuration file directive. 
536<div class="node">
537<p><hr>
538<a name="ntpd-novirtualips"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
539Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-logfile">ntpd logfile</a>,
540Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
541<br>
542</div>
543
544<h4 class="subsection">novirtualips option (-L)</h4>
545
546<p><a name="index-ntpd_002dnovirtualips-15"></a>
547This is the &ldquo;do not listen to virtual interfaces&rdquo; option. 
548Do not listen to virtual interfaces, defined as those with
549names containing a colon.  This option is deprecated.  Please
550consider using the configuration file <code>interface</code> command, which
551is more versatile. 
552<div class="node">
553<p><hr>
554<a name="ntpd-modifymmtimer"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-nice">ntpd nice</a>,
555Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-novirtualips">ntpd novirtualips</a>,
556Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
557<br>
558</div>
559
560<h4 class="subsection">modifymmtimer option (-M)</h4>
561
562<p><a name="index-ntpd_002dmodifymmtimer-16"></a>
563This is the &ldquo;modify multimedia timer (windows only)&rdquo; option.
564
565<p class="noindent">This option has some usage constraints.  It:
566     <ul>
567<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation. 
568</ul>
569
570  <p>Set the Windows Multimedia Timer to highest resolution.  This
571ensures the resolution does not change while ntpd is running,
572avoiding timekeeping glitches associated with changes. 
573<div class="node">
574<p><hr>
575<a name="ntpd-nice"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pidfile">ntpd pidfile</a>,
576Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
577Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
578<br>
579</div>
580
581<h4 class="subsection">nice option (-N)</h4>
582
583<p><a name="index-ntpd_002dnice-17"></a>
584This is the &ldquo;run at high priority&rdquo; option. 
585To the extent permitted by the operating system, run
586<code>ntpd</code>
587at the highest priority. 
588<div class="node">
589<p><hr>
590<a name="ntpd-pidfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-priority">ntpd priority</a>,
591Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-nice">ntpd nice</a>,
592Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
593<br>
594</div>
595
596<h4 class="subsection">pidfile option (-p)</h4>
597
598<p><a name="index-ntpd_002dpidfile-18"></a>
599This is the &ldquo;path to the pid file&rdquo; option. 
600This option takes a string argument. 
601Specify the name and path of the file used to record
602<code>ntpd</code>'s
603process ID. 
604This is the same operation as the
605<code>pidfile</code> <kbd>pidfile</kbd>
606configuration file directive. 
607<div class="node">
608<p><hr>
609<a name="ntpd-priority"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-quit">ntpd quit</a>,
610Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pidfile">ntpd pidfile</a>,
611Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
612<br>
613</div>
614
615<h4 class="subsection">priority option (-P)</h4>
616
617<p><a name="index-ntpd_002dpriority-19"></a>
618This is the &ldquo;process priority&rdquo; option. 
619This option takes a number argument. 
620To the extent permitted by the operating system, run
621<code>ntpd</code>
622at the specified
623<code>sched_setscheduler(SCHED_FIFO)</code>
624priority. 
625<div class="node">
626<p><hr>
627<a name="ntpd-quit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
628Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-priority">ntpd priority</a>,
629Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
630<br>
631</div>
632
633<h4 class="subsection">quit option (-q)</h4>
634
635<p><a name="index-ntpd_002dquit-20"></a>
636This is the &ldquo;set the time and quit&rdquo; option.
637
638<p class="noindent">This option has some usage constraints.  It:
639     <ul>
640<li>must not appear in combination with any of the following options:
641saveconfigquit, wait-sync. 
642</ul>
643
644  <p><code>ntpd</code>
645will not daemonize and will exit after the clock is first
646synchronized.  This behavior mimics that of the
647<code>ntpdate</code>
648program, which will soon be replaced with a shell script. 
649The
650<code>-g</code>
651and
652<code>-x</code>
653options can be used with this option. 
654Note: The kernel time discipline is disabled with this option. 
655<div class="node">
656<p><hr>
657<a name="ntpd-propagationdelay"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
658Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-quit">ntpd quit</a>,
659Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
660<br>
661</div>
662
663<h4 class="subsection">propagationdelay option (-r)</h4>
664
665<p><a name="index-ntpd_002dpropagationdelay-21"></a>
666This is the &ldquo;broadcast/propagation delay&rdquo; option. 
667This option takes a string argument. 
668Specify 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. 
669<div class="node">
670<p><hr>
671<a name="ntpd-saveconfigquit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-statsdir">ntpd statsdir</a>,
672Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
673Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
674<br>
675</div>
676
677<h4 class="subsection">saveconfigquit option</h4>
678
679<p><a name="index-ntpd_002dsaveconfigquit-22"></a>
680This is the &ldquo;save parsed configuration and quit&rdquo; option. 
681This option takes a string argument.
682
683<p class="noindent">This option has some usage constraints.  It:
684     <ul>
685<li>must be compiled in by defining <code>SAVECONFIG</code> during the compilation. 
686<li>must not appear in combination with any of the following options:
687quit, wait-sync. 
688</ul>
689
690  <p>Cause <code>ntpd</code> to parse its startup configuration file and save an
691equivalent to the given filename and exit.  This option was
692designed for automated testing. 
693<div class="node">
694<p><hr>
695<a name="ntpd-statsdir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-trustedkey">ntpd trustedkey</a>,
696Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
697Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
698<br>
699</div>
700
701<h4 class="subsection">statsdir option (-s)</h4>
702
703<p><a name="index-ntpd_002dstatsdir-23"></a>
704This is the &ldquo;statistics file location&rdquo; option. 
705This option takes a string argument. 
706Specify the directory path for files created by the statistics facility. 
707This is the same operation as the
708<code>statsdir</code> <kbd>statsdir</kbd>
709configuration file directive. 
710<div class="node">
711<p><hr>
712<a name="ntpd-trustedkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-user">ntpd user</a>,
713Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-statsdir">ntpd statsdir</a>,
714Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
715<br>
716</div>
717
718<h4 class="subsection">trustedkey option (-t)</h4>
719
720<p><a name="index-ntpd_002dtrustedkey-24"></a>
721This is the &ldquo;trusted key number&rdquo; option. 
722This option takes a string argument <span class="file">tkey</span>.
723
724<p class="noindent">This option has some usage constraints.  It:
725     <ul>
726<li>may appear an unlimited number of times. 
727</ul>
728
729  <p>Add the specified key number to the trusted key list. 
730<div class="node">
731<p><hr>
732<a name="ntpd-user"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-updateinterval">ntpd updateinterval</a>,
733Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-trustedkey">ntpd trustedkey</a>,
734Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
735<br>
736</div>
737
738<h4 class="subsection">user option (-u)</h4>
739
740<p><a name="index-ntpd_002duser-25"></a>
741This is the &ldquo;run as userid (or userid:groupid)&rdquo; option. 
742This option takes a string argument.
743
744<p class="noindent">This option has some usage constraints.  It:
745     <ul>
746<li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation. 
747</ul>
748
749  <p>Specify a user, and optionally a group, to switch to. 
750This option is only available if the OS supports adjusting the clock
751without full root privileges. 
752This option is supported under NetBSD (configure with
753<code>--enable-clockctl</code>) or Linux (configure with
754<code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>). 
755<div class="node">
756<p><hr>
757<a name="ntpd-updateinterval"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
758Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-user">ntpd user</a>,
759Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
760<br>
761</div>
762
763<h4 class="subsection">updateinterval option (-U)</h4>
764
765<p><a name="index-ntpd_002dupdateinterval-26"></a>
766This is the &ldquo;interval in seconds between scans for new or dropped interfaces&rdquo; option. 
767This option takes a number argument. 
768Give the time in seconds between two scans for new or dropped interfaces. 
769For systems with routing socket support the scans will be performed shortly after the interface change
770has been detected by the system. 
771Use 0 to disable scanning. 60 seconds is the minimum time between scans. 
772<div class="node">
773<p><hr>
774<a name="ntpd-wait_002dsync"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-slew">ntpd slew</a>,
775Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-updateinterval">ntpd updateinterval</a>,
776Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
777<br>
778</div>
779
780<h4 class="subsection">wait-sync option (-w)</h4>
781
782<p><a name="index-ntpd_002dwait_002dsync-27"></a>
783This is the &ldquo;seconds to wait for first clock sync&rdquo; option. 
784This option takes a number argument.
785
786<p class="noindent">This option has some usage constraints.  It:
787     <ul>
788<li>must be compiled in by defining <code>HAVE_WORKING_FORK</code> during the compilation. 
789<li>must not appear in combination with any of the following options:
790nofork, quit, saveconfigquit. 
791</ul>
792
793  <p>If greater than zero, alters <code>ntpd</code>'s behavior when forking to
794daemonize.  Instead of exiting with status 0 immediately after
795the fork, the parent waits up to the specified number of
796seconds for the child to first synchronize the clock.  The exit
797status is zero (success) if the clock was synchronized,
798otherwise it is <code>ETIMEDOUT</code>. 
799This provides the option for a script starting <code>ntpd</code> to easily
800wait for the first set of the clock before proceeding. 
801<div class="node">
802<p><hr>
803<a name="ntpd-slew"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-usepcc">ntpd usepcc</a>,
804Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
805Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
806<br>
807</div>
808
809<h4 class="subsection">slew option (-x)</h4>
810
811<p><a name="index-ntpd_002dslew-28"></a>
812This is the &ldquo;slew up to 600 seconds&rdquo; option. 
813Normally, 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. 
814This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. 
815Note: 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. 
816Thus, an adjustment as much as 600 s will take almost 14 days to complete. 
817This option can be used with the
818<code>-g</code>
819and
820<code>-q</code>
821options. 
822See the
823<code>tinker</code>
824configuration file directive for other options. 
825Note: The kernel time discipline is disabled with this option. 
826<div class="node">
827<p><hr>
828<a name="ntpd-usepcc"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pccfreq">ntpd pccfreq</a>,
829Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-slew">ntpd slew</a>,
830Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
831<br>
832</div>
833
834<h4 class="subsection">usepcc option</h4>
835
836<p><a name="index-ntpd_002dusepcc-29"></a>
837This is the &ldquo;use cpu cycle counter (windows only)&rdquo; option.
838
839<p class="noindent">This option has some usage constraints.  It:
840     <ul>
841<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation. 
842</ul>
843
844  <p>Attempt to substitute the CPU counter for <code>QueryPerformanceCounter</code>. 
845The CPU counter and <code>QueryPerformanceCounter</code> are compared, and if
846they have the same frequency, the CPU counter (RDTSC on x86) is
847used directly, saving the overhead of a system call. 
848<div class="node">
849<p><hr>
850<a name="ntpd-pccfreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-mdns">ntpd mdns</a>,
851Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usepcc">ntpd usepcc</a>,
852Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
853<br>
854</div>
855
856<h4 class="subsection">pccfreq option</h4>
857
858<p><a name="index-ntpd_002dpccfreq-30"></a>
859This is the &ldquo;force cpu cycle counter use (windows only)&rdquo; option. 
860This option takes a string argument.
861
862<p class="noindent">This option has some usage constraints.  It:
863     <ul>
864<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation. 
865</ul>
866
867  <p>Force substitution the CPU counter for <code>QueryPerformanceCounter</code>. 
868The CPU counter (RDTSC on x86) is used unconditionally with the
869given frequency (in Hz). 
870<div class="node">
871<p><hr>
872<a name="ntpd-mdns"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-config">ntpd config</a>,
873Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pccfreq">ntpd pccfreq</a>,
874Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
875<br>
876</div>
877
878<h4 class="subsection">mdns option (-m)</h4>
879
880<p><a name="index-ntpd_002dmdns-31"></a>
881This is the &ldquo;register with mdns as a ntp server&rdquo; option.
882
883<p class="noindent">This option has some usage constraints.  It:
884     <ul>
885<li>must be compiled in by defining <code>HAVE_DNSREGISTRATION</code> during the compilation. 
886</ul>
887
888  <p>Registers as an NTP server with the local mDNS server which allows
889the server to be discovered via mDNS client lookup.
890
891<div class="node">
892<p><hr>
893<a name="ntpd-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-exit-status">ntpd exit status</a>,
894Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-mdns">ntpd mdns</a>,
895Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
896<br>
897</div>
898
899<h4 class="subsection">presetting/configuring ntpd</h4>
900
901<p>Any option that is not marked as <i>not presettable</i> may be preset by
902loading 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
903the options listed above in upper case and segmented with underscores. 
904The <code>NTPD</code> variable will be tokenized and parsed like
905the command line.  The remaining variables are tested for existence and their
906values are treated like option arguments.
907
908  <p>The command line options relating to configuration and/or usage help are:
909
910<h5 class="subsubheading">version (-)</h5>
911
912<p>Print the program version to standard out, optionally with licensing
913information, then exit 0.  The optional argument specifies how much licensing
914detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument. 
915Only the first letter of the argument is examined:
916
917     <dl>
918<dt><span class="samp">version</span><dd>Only print the version.  This is the default. 
919<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms. 
920<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms. 
921</dl>
922
923<div class="node">
924<p><hr>
925<a name="ntpd-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Usage">ntpd Usage</a>,
926Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-config">ntpd config</a>,
927Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
928<br>
929</div>
930
931<h4 class="subsection">ntpd exit status</h4>
932
933<p>One of the following exit values will be returned:
934     <dl>
935<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 
936<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 
937</dl>
938  <div class="node">
939<p><hr>
940<a name="ntpd-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Files">ntpd Files</a>,
941Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-exit-status">ntpd exit status</a>,
942Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
943<br>
944</div>
945
946<h4 class="subsection">ntpd Usage</h4>
947
948<div class="node">
949<p><hr>
950<a name="ntpd-Files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-See-Also">ntpd See Also</a>,
951Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Usage">ntpd Usage</a>,
952Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
953<br>
954</div>
955
956<h4 class="subsection">ntpd Files</h4>
957
958<div class="node">
959<p><hr>
960<a name="ntpd-See-Also"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Bugs">ntpd Bugs</a>,
961Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Files">ntpd Files</a>,
962Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
963<br>
964</div>
965
966<h4 class="subsection">ntpd See Also</h4>
967
968<div class="node">
969<p><hr>
970<a name="ntpd-Bugs"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Notes">ntpd Notes</a>,
971Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-See-Also">ntpd See Also</a>,
972Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
973<br>
974</div>
975
976<h4 class="subsection">ntpd Bugs</h4>
977
978<div class="node">
979<p><hr>
980<a name="ntpd-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Bugs">ntpd Bugs</a>,
981Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
982<br>
983</div>
984
985<h4 class="subsection">ntpd Notes</h4>
986
987<div class="node">
988<p><hr>
989<a name="Usage"></a>
990<br>
991</div>
992
993<!-- node-name,  next,  previous,  up -->
994<h3 class="section">Usage</h3>
995
996