ntpd.1ntpdman revision 1.1 1 .de1 NOP
2 . it 1 an-trap
3 . if \\n[.$] \,\\$*\/
4 ..
5 .ie t \
6 .ds B-Font [CB]
7 .ds I-Font [CI]
8 .ds R-Font [CR]
9 .el \
10 .ds B-Font B
11 .ds I-Font I
12 .ds R-Font R
13 .TH ntpd 1ntpdman "24 Dec 2013" "4.2.7p404" "User Commands"
14 .\"
15 .\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-3Ba4gQ/ag-eCa4fQ)
16 .\"
17 .\" It has been AutoGen-ed December 24, 2013 at 11:38:10 AM by AutoGen 5.18.3pre5
18 .\" From the definitions ntpd-opts.def
19 .\" and the template file agman-cmd.tpl
20 .SH NAME
21 \f\*[B-Font]ntpd\fP
22 \- NTP daemon program
23 .SH SYNOPSIS
24 \f\*[B-Font]ntpd\fP
25 .\" Mixture of short (flag) options and long options
26 [\f\*[B-Font]\-flags\f[]]
27 [\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
28 [\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
29 [ <server1> ... <serverN> ]
30 .sp \n(Ppu
31 .ne 2
32
33 .SH DESCRIPTION
34 The
35 \f\*[B-Font]ntpd\fP
36 utility is an operating system daemon which sets
37 and maintains the system time of day in synchronism with Internet
38 standard time servers.
39 It is a complete implementation of the
40 Network Time Protocol (NTP) version 4, as defined by RFC-5905,
41 but also retains compatibility with
42 version 3, as defined by RFC-1305, and versions 1
43 and 2, as defined by RFC-1059 and RFC-1119, respectively.
44 .sp \n(Ppu
45 .ne 2
46
47 The
48 \f\*[B-Font]ntpd\fP
49 utility does most computations in 64-bit floating point
50 arithmetic and does relatively clumsy 64-bit fixed point operations
51 only when necessary to preserve the ultimate precision, about 232
52 picoseconds.
53 While the ultimate precision is not achievable with
54 ordinary workstations and networks of today, it may be required
55 with future gigahertz CPU clocks and gigabit LANs.
56 .sp \n(Ppu
57 .ne 2
58
59 Ordinarily,
60 \f\*[B-Font]ntpd\fP
61 reads the
62 \fCntp.conf\fR(5)\f[]
63 configuration file at startup time in order to determine the
64 synchronization sources and operating modes.
65 It is also possible to
66 specify a working, although limited, configuration entirely on the
67 command line, obviating the need for a configuration file.
68 This may
69 be particularly useful when the local host is to be configured as a
70 broadcast/multicast client, with all peers being determined by
71 listening to broadcasts at run time.
72 .sp \n(Ppu
73 .ne 2
74
75 If NetInfo support is built into
76 \f\*[B-Font]ntpd\fP,
77 then
78 \f\*[B-Font]ntpd\fP
79 will attempt to read its configuration from the
80 NetInfo if the default
81 \fCntp.conf\fR(5)\f[]
82 file cannot be read and no file is
83 specified by the
84 \f\*[B-Font]\-c\f[]
85 option.
86 .sp \n(Ppu
87 .ne 2
88
89 Various internal
90 \f\*[B-Font]ntpd\fP
91 variables can be displayed and
92 configuration options altered while the
93 \f\*[B-Font]ntpd\fP
94 is running
95 using the
96 \fCntpq\fR(1ntpqmdoc)\f[]
97 and
98 \fCntpdc\fR(1ntpdcmdoc)\f[]
99 utility programs.
100 .sp \n(Ppu
101 .ne 2
102
103 When
104 \f\*[B-Font]ntpd\fP
105 starts it looks at the value of
106 \fCumask\fR(2)\f[],
107 and if zero
108 \f\*[B-Font]ntpd\fP
109 will set the
110 \fCumask\fR(2)\f[]
111 to 022.
112 .SH "OPTIONS"
113 .TP
114 .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
115 Force IPv4 DNS name resolution.
116 This option must not appear in combination with any of the following options:
117 ipv6.
118 .sp
119 Force DNS resolution of following host names on the command line
120 to the IPv4 namespace.
121 .TP
122 .NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
123 Force IPv6 DNS name resolution.
124 This option must not appear in combination with any of the following options:
125 ipv4.
126 .sp
127 Force DNS resolution of following host names on the command line
128 to the IPv6 namespace.
129 .TP
130 .NOP \f\*[B-Font]\-a\f[], \f\*[B-Font]\-\-authreq\f[]
131 Require crypto authentication.
132 This option must not appear in combination with any of the following options:
133 authnoreq.
134 .sp
135 Require cryptographic authentication for broadcast client,
136 multicast client and symmetric passive associations.
137 This is the default.
138 .TP
139 .NOP \f\*[B-Font]\-A\f[], \f\*[B-Font]\-\-authnoreq\f[]
140 Do not require crypto authentication.
141 This option must not appear in combination with any of the following options:
142 authreq.
143 .sp
144 Do not require cryptographic authentication for broadcast client,
145 multicast client and symmetric passive associations.
146 This is almost never a good idea.
147 .TP
148 .NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-bcastsync\f[]
149 Allow us to sync to broadcast servers.
150 .sp
151 .TP
152 .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-configfile\f[]=\f\*[I-Font]string\f[]
153 configuration file name.
154 .sp
155 The name and path of the configuration file,
156 \fI/etc/ntp.conf\fP
157 by default.
158 .TP
159 .NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
160 Increase debug verbosity level.
161 This option may appear an unlimited number of times.
162 .sp
163 .TP
164 .NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
165 Set the debug verbosity level.
166 This option may appear an unlimited number of times.
167 This option takes an integer number as its argument.
168 .sp
169 .TP
170 .NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-driftfile\f[]=\f\*[I-Font]string\f[]
171 frequency drift file name.
172 .sp
173 The name and path of the frequency file,
174 \fI/etc/ntp.drift\fP
175 by default.
176 This is the same operation as the
177 \fBdriftfile\fP \fIdriftfile\fP
178 configuration specification in the
179 \fI/etc/ntp.conf\fP
180 file.
181 .TP
182 .NOP \f\*[B-Font]\-g\f[], \f\*[B-Font]\-\-panicgate\f[]
183 Allow the first adjustment to be Big.
184 This option may appear an unlimited number of times.
185 .sp
186 Normally,
187 \fBntpd\fP
188 exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
189 \fBntpd\fP
190 will exit with a message to the system log. This option can be used with the
191 \fB-q\fP
192 and
193 \fB-x\fP
194 options.
195 See the
196 \fBtinker\fP
197 configuration file directive for other options.
198 .TP
199 .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
200 Jail directory.
201 .sp
202 Chroot the server to the directory
203 \fIjaildir\fP
204 .
205 This option also implies that the server attempts to drop root privileges at startup.
206 You may need to also specify a
207 \fB-u\fP
208 option.
209 This option is only available if the OS supports adjusting the clock
210 without full root privileges.
211 This option is supported under NetBSD (configure with
212 \fB--enable-clockctl\fP) or Linux (configure with
213 \fB--enable-linuxcaps\fP) or Solaris (configure with \fB--enable-solarisprivs\fP).
214 .TP
215 .NOP \f\*[B-Font]\-I\f[] \f\*[I-Font]iface\f[], \f\*[B-Font]\-\-interface\f[]=\f\*[I-Font]iface\f[]
216 Listen on an interface name or address.
217 This option may appear an unlimited number of times.
218 .sp
219 Open the network address given, or all the addresses associated with the
220 given interface name. This option may appear multiple times. This option
221 also implies not opening other addresses, except wildcard and localhost.
222 This option is deprecated. Please consider using the configuration file
223 \fBinterface\fP command, which is more versatile.
224 .TP
225 .NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[]
226 path to symmetric keys.
227 .sp
228 Specify the name and path of the symmetric key file.
229 \fI/etc/ntp.keys\fP
230 is the default.
231 This is the same operation as the
232 \fBkeys\fP \fIkeyfile\fP
233 configuration file directive.
234 .TP
235 .NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]string\f[]
236 path to the log file.
237 .sp
238 Specify the name and path of the log file.
239 The default is the system log file.
240 This is the same operation as the
241 \fBlogfile\fP \fIlogfile\fP
242 configuration file directive.
243 .TP
244 .NOP \f\*[B-Font]\-L\f[], \f\*[B-Font]\-\-novirtualips\f[]
245 Do not listen to virtual interfaces.
246 .sp
247 Do not listen to virtual interfaces, defined as those with
248 names containing a colon. This option is deprecated. Please
249 consider using the configuration file \fBinterface\fP command, which
250 is more versatile.
251 .TP
252 .NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-modifymmtimer\f[]
253 Modify Multimedia Timer (Windows only).
254 .sp
255 Set the Windows Multimedia Timer to highest resolution. This
256 ensures the resolution does not change while ntpd is running,
257 avoiding timekeeping glitches associated with changes.
258 .TP
259 .NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[]
260 Do not fork.
261 This option must not appear in combination with any of the following options:
262 wait-sync.
263 .sp
264 .TP
265 .NOP \f\*[B-Font]\-N\f[], \f\*[B-Font]\-\-nice\f[]
266 Run at high priority.
267 .sp
268 To the extent permitted by the operating system, run
269 \fBntpd\fP
270 at the highest priority.
271 .TP
272 .NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pidfile\f[]=\f\*[I-Font]string\f[]
273 path to the PID file.
274 .sp
275 Specify the name and path of the file used to record
276 \fBntpd\fP's
277 process ID.
278 This is the same operation as the
279 \fBpidfile\fP \fIpidfile\fP
280 configuration file directive.
281 .TP
282 .NOP \f\*[B-Font]\-P\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-priority\f[]=\f\*[I-Font]number\f[]
283 Process priority.
284 This option takes an integer number as its argument.
285 .sp
286 To the extent permitted by the operating system, run
287 \fBntpd\fP
288 at the specified
289 \fBsched_setscheduler(SCHED_FIFO)\fP
290 priority.
291 .TP
292 .NOP \f\*[B-Font]\-q\f[], \f\*[B-Font]\-\-quit\f[]
293 Set the time and quit.
294 This option must not appear in combination with any of the following options:
295 saveconfigquit, wait-sync.
296 .sp
297 \fBntpd\fP
298 will not daemonize and will exit after the clock is first
299 synchronized. This behavior mimics that of the
300 \fBntpdate\fP
301 program, which will soon be replaced with a shell script.
302 The
303 \fB-g\fP
304 and
305 \fB-x\fP
306 options can be used with this option.
307 Note: The kernel time discipline is disabled with this option.
308 .TP
309 .NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-propagationdelay\f[]=\f\*[I-Font]string\f[]
310 Broadcast/propagation delay.
311 .sp
312 Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
313 .TP
314 .NOP \f\*[B-Font]\-\-saveconfigquit\f[]=\f\*[I-Font]string\f[]
315 Save parsed configuration and quit.
316 This option must not appear in combination with any of the following options:
317 quit, wait-sync.
318 .sp
319 Cause \fBntpd\fP to parse its startup configuration file and save an
320 equivalent to the given filename and exit. This option was
321 designed for automated testing.
322 .TP
323 .NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-statsdir\f[]=\f\*[I-Font]string\f[]
324 Statistics file location.
325 .sp
326 Specify the directory path for files created by the statistics facility.
327 This is the same operation as the
328 \fBstatsdir\fP \fIstatsdir\fP
329 configuration file directive.
330 .TP
331 .NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]tkey\f[], \f\*[B-Font]\-\-trustedkey\f[]=\f\*[I-Font]tkey\f[]
332 Trusted key number.
333 This option may appear an unlimited number of times.
334 .sp
335 Add the specified key number to the trusted key list.
336 .TP
337 .NOP \f\*[B-Font]\-u\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-user\f[]=\f\*[I-Font]string\f[]
338 Run as userid (or userid:groupid).
339 .sp
340 Specify a user, and optionally a group, to switch to.
341 This option is only available if the OS supports adjusting the clock
342 without full root privileges.
343 This option is supported under NetBSD (configure with
344 \fB--enable-clockctl\fP) or Linux (configure with
345 \fB--enable-linuxcaps\fP) or Solaris (configure with \fB--enable-solarisprivs\fP).
346 .TP
347 .NOP \f\*[B-Font]\-U\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-updateinterval\f[]=\f\*[I-Font]number\f[]
348 interval in seconds between scans for new or dropped interfaces.
349 This option takes an integer number as its argument.
350 .sp
351 Give the time in seconds between two scans for new or dropped interfaces.
352 For systems with routing socket support the scans will be performed shortly after the interface change
353 has been detected by the system.
354 Use 0 to disable scanning. 60 seconds is the minimum time between scans.
355 .TP
356 .NOP \f\*[B-Font]\-\-var\f[]=\f\*[I-Font]nvar\f[]
357 make ARG an ntp variable (RW).
358 This option may appear an unlimited number of times.
359 .sp
360 .TP
361 .NOP \f\*[B-Font]\-\-dvar\f[]=\f\*[I-Font]ndvar\f[]
362 make ARG an ntp variable (RW|DEF).
363 This option may appear an unlimited number of times.
364 .sp
365 .TP
366 .NOP \f\*[B-Font]\-w\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-wait\-sync\f[]=\f\*[I-Font]number\f[]
367 Seconds to wait for first clock sync.
368 This option must not appear in combination with any of the following options:
369 nofork, quit, saveconfigquit.
370 This option takes an integer number as its argument.
371 .sp
372 If greater than zero, alters \fBntpd\fP's behavior when forking to
373 daemonize. Instead of exiting with status 0 immediately after
374 the fork, the parent waits up to the specified number of
375 seconds for the child to first synchronize the clock. The exit
376 status is zero (success) if the clock was synchronized,
377 otherwise it is \fBETIMEDOUT\fP.
378 This provides the option for a script starting \fBntpd\fP to easily
379 wait for the first set of the clock before proceeding.
380 .TP
381 .NOP \f\*[B-Font]\-x\f[], \f\*[B-Font]\-\-slew\f[]
382 Slew up to 600 seconds.
383 .sp
384 Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
385 This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
386 Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
387 Thus, an adjustment as much as 600 s will take almost 14 days to complete.
388 This option can be used with the
389 \fB-g\fP
390 and
391 \fB-q\fP
392 options.
393 See the
394 \fBtinker\fP
395 configuration file directive for other options.
396 Note: The kernel time discipline is disabled with this option.
397 .TP
398 .NOP \f\*[B-Font]\-\-usepcc\f[]
399 Use CPU cycle counter (Windows only).
400 .sp
401 Attempt to substitute the CPU counter for \fBQueryPerformanceCounter\fP.
402 The CPU counter and \fBQueryPerformanceCounter\fP are compared, and if
403 they have the same frequency, the CPU counter (RDTSC on x86) is
404 used directly, saving the overhead of a system call.
405 .TP
406 .NOP \f\*[B-Font]\-\-pccfreq\f[]=\f\*[I-Font]string\f[]
407 Force CPU cycle counter use (Windows only).
408 .sp
409 Force substitution the CPU counter for \fBQueryPerformanceCounter\fP.
410 The CPU counter (RDTSC on x86) is used unconditionally with the
411 given frequency (in Hz).
412 .TP
413 .NOP \f\*[B-Font]\-m\f[], \f\*[B-Font]\-\-mdns\f[]
414 Register with mDNS as a NTP server.
415 .sp
416 Registers as an NTP server with the local mDNS server which allows
417 the server to be discovered via mDNS client lookup.
418 .TP
419 .NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
420 Display usage information and exit.
421 .TP
422 .NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
423 Pass the extended usage information through a pager.
424 .TP
425 .NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
426 Output version of program and exit. The default mode is `v', a simple
427 version. The `c' mode will print copyright information and `n' will
428 print the full copyright notice.
429 .PP
430 .SH "OPTION PRESETS"
431 Any option that is not marked as \fInot presettable\fP may be preset
432 by loading values from environment variables named:
433 .nf
434 \fBNTPD_<option-name>\fP or \fBNTPD\fP
435 .fi
436 .ad
437 .TH ntpd 1ntpdman "24 Dec 2013" "4.2.7p404" "User Commands"
438 .\"
439 .\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-3Ba4gQ/ag-eCa4fQ)
440 .\"
441 .\" It has been AutoGen-ed December 24, 2013 at 11:38:10 AM by AutoGen 5.18.3pre5
442 .\" From the definitions ntpd-opts.def
443 .\" and the template file agman-cmd.tpl
444 .SH NAME
445 \f\*[B-Font]ntpd\fP ntpd
446 \- NTP daemon program
447 cvt_prog='/usr/local/gnu/share/autogen/texi2man'
448 cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd
449 `/`basename "$cvt_prog"`
450 cd $tmp_dir
451 test \-x "$cvt_prog" || die "'$cvt_prog' is not executable"
452 {
453 list='synopsis description options option-presets'
454 for f in $list ; do cat $f ; echo ; done
455 rm \-f $list name
456 list='implementation-notes environment files examples exit-status errors
457 compatibility see-also conforming-to history authors copyright bugs
458 notes'
459 for f in $list ; do cat $f ; echo ; done > .end-doc
460 rm \-f $list
461 list=`ls \-1 *`' .end-doc'
462 for f in $list ; do cat $f ; echo ; done
463 rm \-f $list
464 } 1>.doc 2>/dev/null
465 sed \-f .cmds .doc | /usr/local/gnu/bin/grep \-E \-v '^[ ]*$' | $cvt_prog
466 .SH USAGE
467 .SS "How NTP Operates"
468 The
469 \f\*[B-Font]ntpd\fP
470 utility operates by exchanging messages with
471 one or more configured servers over a range of designated poll intervals.
472 When
473 started, whether for the first or subsequent times, the program
474 requires several exchanges from the majority of these servers so
475 the signal processing and mitigation algorithms can accumulate and
476 groom the data and set the clock.
477 In order to protect the network
478 from bursts, the initial poll interval for each server is delayed
479 an interval randomized over a few seconds.
480 At the default initial poll
481 interval of 64s, several minutes can elapse before the clock is
482 set.
483 This initial delay to set the clock
484 can be safely and dramatically reduced using the
485 \f\*[B-Font]iburst\f[]
486 keyword with the
487 \f\*[B-Font]server\f[]
488 configuration
489 command, as described in
490 \fCntp.conf\fR(5)\f[].
491 .sp \n(Ppu
492 .ne 2
493
494 Most operating systems and hardware of today incorporate a
495 time-of-year (TOY) chip to maintain the time during periods when
496 the power is off.
497 When the machine is booted, the chip is used to
498 initialize the operating system time.
499 After the machine has
500 synchronized to a NTP server, the operating system corrects the
501 chip from time to time.
502 In the default case, if
503 \f\*[B-Font]ntpd\fP
504 detects that the time on the host
505 is more than 1000s from the server time,
506 \f\*[B-Font]ntpd\fP
507 assumes something must be terribly wrong and the only
508 reliable action is for the operator to intervene and set the clock
509 by hand.
510 (Reasons for this include there is no TOY chip,
511 or its battery is dead, or that the TOY chip is just of poor quality.)
512 This causes
513 \f\*[B-Font]ntpd\fP
514 to exit with a panic message to
515 the system log.
516 The
517 \f\*[B-Font]\-g\f[]
518 option overrides this check and the
519 clock will be set to the server time regardless of the chip time
520 (up to 68 years in the past or future \(em
521 this is a limitation of the NTPv4 protocol).
522 However, and to protect against broken hardware, such as when the
523 CMOS battery fails or the clock counter becomes defective, once the
524 clock has been set an error greater than 1000s will cause
525 \f\*[B-Font]ntpd\fP
526 to exit anyway.
527 .sp \n(Ppu
528 .ne 2
529
530 Under ordinary conditions,
531 \f\*[B-Font]ntpd\fP
532 adjusts the clock in
533 small steps so that the timescale is effectively continuous and
534 without discontinuities.
535 Under conditions of extreme network
536 congestion, the roundtrip delay jitter can exceed three seconds and
537 the synchronization distance, which is equal to one-half the
538 roundtrip delay plus error budget terms, can become very large.
539 The
540 \f\*[B-Font]ntpd\fP
541 algorithms discard sample offsets exceeding 128 ms,
542 unless the interval during which no sample offset is less than 128
543 ms exceeds 900s.
544 The first sample after that, no matter what the
545 offset, steps the clock to the indicated time.
546 In practice this
547 reduces the false alarm rate where the clock is stepped in error to
548 a vanishingly low incidence.
549 .sp \n(Ppu
550 .ne 2
551
552 As the result of this behavior, once the clock has been set it
553 very rarely strays more than 128 ms even under extreme cases of
554 network path congestion and jitter.
555 Sometimes, in particular when
556 \f\*[B-Font]ntpd\fP
557 is first started without a valid drift file
558 on a system with a large intrinsic drift
559 the error might grow to exceed 128 ms,
560 which would cause the clock to be set backwards
561 if the local clock time is more than 128 s
562 in the future relative to the server.
563 In some applications, this behavior may be unacceptable.
564 There are several solutions, however.
565 If the
566 \f\*[B-Font]\-x\f[]
567 option is included on the command line, the clock will
568 never be stepped and only slew corrections will be used.
569 But this choice comes with a cost that
570 should be carefully explored before deciding to use
571 the
572 \f\*[B-Font]\-x\f[]
573 option.
574 The maximum slew rate possible is limited
575 to 500 parts-per-million (PPM) as a consequence of the correctness
576 principles on which the NTP protocol and algorithm design are
577 based.
578 As a result, the local clock can take a long time to
579 converge to an acceptable offset, about 2,000 s for each second the
580 clock is outside the acceptable range.
581 During this interval the
582 local clock will not be consistent with any other network clock and
583 the system cannot be used for distributed applications that require
584 correctly synchronized network time.
585 .sp \n(Ppu
586 .ne 2
587
588 In spite of the above precautions, sometimes when large
589 frequency errors are present the resulting time offsets stray
590 outside the 128-ms range and an eventual step or slew time
591 correction is required.
592 If following such a correction the
593 frequency error is so large that the first sample is outside the
594 acceptable range,
595 \f\*[B-Font]ntpd\fP
596 enters the same state as when the
597 \fIntp.drift\f[]
598 file is not present.
599 The intent of this behavior
600 is to quickly correct the frequency and restore operation to the
601 normal tracking mode.
602 In the most extreme cases
603 (the host
604 \f\*[B-Font]time.ien.it\f[]
605 comes to mind), there may be occasional
606 step/slew corrections and subsequent frequency corrections.
607 It
608 helps in these cases to use the
609 \f\*[B-Font]burst\f[]
610 keyword when
611 configuring the server, but
612 ONLY
613 when you have permission to do so from the owner of the target host.
614 .sp \n(Ppu
615 .ne 2
616
617 Finally,
618 in the past many startup scripts would run
619 \fCntpdate\fR(1ntpdatemdoc)\f[]
620 to get the system clock close to correct before starting
621 \fCntpd\fR(1ntpdmdoc)\f[],
622 but this was never more than a mediocre hack and is no longer needed.
623 .sp \n(Ppu
624 .ne 2
625
626 There is a way to start
627 \fCntpd\fR(1ntpdmdoc)\f[]
628 that often addresses all of the problems mentioned above.
629 .SS "Starting NTP (Best Current Practice)"
630 First, use the
631 \f\*[B-Font]iburst\f[]
632 option on your
633 \f\*[B-Font]server\f[]
634 entries.
635 .sp \n(Ppu
636 .ne 2
637
638 If you can also keep a good
639 \fIntp.drift\f[]
640 file then
641 \fCntpd\fR(1ntpdmdoc)\f[]
642 will effectively "warm-start" and your system's clock will
643 be stable in under 11 seconds' time.
644 .sp \n(Ppu
645 .ne 2
646
647 As soon as possible in the startup sequence, start
648 \fCntpd\fR(1ntpdmdoc)\f[]
649 with at least the
650 \f\*[B-Font]\-g\f[]
651 and perhaps the
652 \f\*[B-Font]\-N\f[]
653 options.
654 Then,
655 start the rest of your "normal" processes.
656 This will give
657 \fCntpd\fR(1ntpdmdoc)\f[]
658 as much time as possible to get the system's clock synchronized and stable.
659 .sp \n(Ppu
660 .ne 2
661
662 Finally,
663 if you have processes like
664 \f\*[B-Font]dovecot\f[]
665 or database servers
666 that require
667 monotonically-increasing time,
668 run
669 \fCntp-wait\fR(1ntp-waitmdoc)\f[]
670 as late as possible in the boot sequence
671 (perhaps with the
672 \f\*[B-Font]\-v\f[]
673 flag)
674 and after
675 \fCntp-wait\fR(1ntp-waitmdoc)\f[]
676 exits successfully
677 it is as safe as it will ever be to start any process that require
678 stable time.
679 .SS "Frequency Discipline"
680 The
681 \f\*[B-Font]ntpd\fP
682 behavior at startup depends on whether the
683 frequency file, usually
684 \fIntp.drift\f[],
685 exists.
686 This file
687 contains the latest estimate of clock frequency error.
688 When the
689 \f\*[B-Font]ntpd\fP
690 is started and the file does not exist, the
691 \f\*[B-Font]ntpd\fP
692 enters a special mode designed to quickly adapt to
693 the particular system clock oscillator time and frequency error.
694 This takes approximately 15 minutes, after which the time and
695 frequency are set to nominal values and the
696 \f\*[B-Font]ntpd\fP
697 enters
698 normal mode, where the time and frequency are continuously tracked
699 relative to the server.
700 After one hour the frequency file is
701 created and the current frequency offset written to it.
702 When the
703 \f\*[B-Font]ntpd\fP
704 is started and the file does exist, the
705 \f\*[B-Font]ntpd\fP
706 frequency is initialized from the file and enters normal mode
707 immediately.
708 After that the current frequency offset is written to
709 the file at hourly intervals.
710 .SS "Operating Modes"
711 The
712 \f\*[B-Font]ntpd\fP
713 utility can operate in any of several modes, including
714 symmetric active/passive, client/server broadcast/multicast and
715 manycast, as described in the
716 "Association Management"
717 page
718 (available as part of the HTML documentation
719 provided in
720 \fI/usr/share/doc/ntp\f[]).
721 It normally operates continuously while
722 monitoring for small changes in frequency and trimming the clock
723 for the ultimate precision.
724 However, it can operate in a one-time
725 mode where the time is set from an external server and frequency is
726 set from a previously recorded frequency file.
727 A
728 broadcast/multicast or manycast client can discover remote servers,
729 compute server-client propagation delay correction factors and
730 configure itself automatically.
731 This makes it possible to deploy a
732 fleet of workstations without specifying configuration details
733 specific to the local environment.
734 .sp \n(Ppu
735 .ne 2
736
737 By default,
738 \f\*[B-Font]ntpd\fP
739 runs in continuous mode where each of
740 possibly several external servers is polled at intervals determined
741 by an intricate state machine.
742 The state machine measures the
743 incidental roundtrip delay jitter and oscillator frequency wander
744 and determines the best poll interval using a heuristic algorithm.
745 Ordinarily, and in most operating environments, the state machine
746 will start with 64s intervals and eventually increase in steps to
747 1024s.
748 A small amount of random variation is introduced in order to
749 avoid bunching at the servers.
750 In addition, should a server become
751 unreachable for some time, the poll interval is increased in steps
752 to 1024s in order to reduce network overhead.
753 .sp \n(Ppu
754 .ne 2
755
756 In some cases it may not be practical for
757 \f\*[B-Font]ntpd\fP
758 to run
759 continuously.
760 A common workaround has been to run the
761 \fCntpdate\fR(1ntpdatemdoc)\f[]
762 program from a
763 \fCcron\fR(8)\f[]
764 job at designated
765 times.
766 However, this program does not have the crafted signal
767 processing, error checking and mitigation algorithms of
768 \f\*[B-Font]ntpd\fP.
769 The
770 \f\*[B-Font]\-q\f[]
771 option is intended for this purpose.
772 Setting this option will cause
773 \f\*[B-Font]ntpd\fP
774 to exit just after
775 setting the clock for the first time.
776 The procedure for initially
777 setting the clock is the same as in continuous mode; most
778 applications will probably want to specify the
779 \f\*[B-Font]iburst\f[]
780 keyword with the
781 \f\*[B-Font]server\f[]
782 configuration command.
783 With this
784 keyword a volley of messages are exchanged to groom the data and
785 the clock is set in about 10 s.
786 If nothing is heard after a
787 couple of minutes, the daemon times out and exits.
788 After a suitable
789 period of mourning, the
790 \fCntpdate\fR(1ntpdatemdoc)\f[]
791 program may be
792 retired.
793 .sp \n(Ppu
794 .ne 2
795
796 When kernel support is available to discipline the clock
797 frequency, which is the case for stock Solaris, Tru64, Linux and
798 FreeBSD,
799 a useful feature is available to discipline the clock
800 frequency.
801 First,
802 \f\*[B-Font]ntpd\fP
803 is run in continuous mode with
804 selected servers in order to measure and record the intrinsic clock
805 frequency offset in the frequency file.
806 It may take some hours for
807 the frequency and offset to settle down.
808 Then the
809 \f\*[B-Font]ntpd\fP
810 is
811 stopped and run in one-time mode as required.
812 At each startup, the
813 frequency is read from the file and initializes the kernel
814 frequency.
815 .SS "Poll Interval Control"
816 This version of NTP includes an intricate state machine to
817 reduce the network load while maintaining a quality of
818 synchronization consistent with the observed jitter and wander.
819 There are a number of ways to tailor the operation in order enhance
820 accuracy by reducing the interval or to reduce network overhead by
821 increasing it.
822 However, the user is advised to carefully consider
823 the consequences of changing the poll adjustment range from the
824 default minimum of 64 s to the default maximum of 1,024 s.
825 The
826 default minimum can be changed with the
827 \f\*[B-Font]tinker\f[]
828 \f\*[B-Font]minpoll\f[]
829 command to a value not less than 16 s.
830 This value is used for all
831 configured associations, unless overridden by the
832 \f\*[B-Font]minpoll\f[]
833 option on the configuration command.
834 Note that most device drivers
835 will not operate properly if the poll interval is less than 64 s
836 and that the broadcast server and manycast client associations will
837 also use the default, unless overridden.
838 .sp \n(Ppu
839 .ne 2
840
841 In some cases involving dial up or toll services, it may be
842 useful to increase the minimum interval to a few tens of minutes
843 and maximum interval to a day or so.
844 Under normal operation
845 conditions, once the clock discipline loop has stabilized the
846 interval will be increased in steps from the minimum to the
847 maximum.
848 However, this assumes the intrinsic clock frequency error
849 is small enough for the discipline loop correct it.
850 The capture
851 range of the loop is 500 PPM at an interval of 64s decreasing by a
852 factor of two for each doubling of interval.
853 At a minimum of 1,024
854 s, for example, the capture range is only 31 PPM.
855 If the intrinsic
856 error is greater than this, the drift file
857 \fIntp.drift\f[]
858 will
859 have to be specially tailored to reduce the residual error below
860 this limit.
861 Once this is done, the drift file is automatically
862 updated once per hour and is available to initialize the frequency
863 on subsequent daemon restarts.
864 .SS "The huff-n'-puff Filter"
865 In scenarios where a considerable amount of data are to be
866 downloaded or uploaded over telephone modems, timekeeping quality
867 can be seriously degraded.
868 This occurs because the differential
869 delays on the two directions of transmission can be quite large.
870 In
871 many cases the apparent time errors are so large as to exceed the
872 step threshold and a step correction can occur during and after the
873 data transfer is in progress.
874 .sp \n(Ppu
875 .ne 2
876
877 The huff-n'-puff filter is designed to correct the apparent time
878 offset in these cases.
879 It depends on knowledge of the propagation
880 delay when no other traffic is present.
881 In common scenarios this
882 occurs during other than work hours.
883 The filter maintains a shift
884 register that remembers the minimum delay over the most recent
885 interval measured usually in hours.
886 Under conditions of severe
887 delay, the filter corrects the apparent offset using the sign of
888 the offset and the difference between the apparent delay and
889 minimum delay.
890 The name of the filter reflects the negative (huff)
891 and positive (puff) correction, which depends on the sign of the
892 offset.
893 .sp \n(Ppu
894 .ne 2
895
896 The filter is activated by the
897 \f\*[B-Font]tinker\f[]
898 command and
899 \f\*[B-Font]huffpuff\f[]
900 keyword, as described in
901 \fCntp.conf\fR(5)\f[].
902 .SH "ENVIRONMENT"
903 See \fBOPTION PRESETS\fP for configuration environment variables.
904 .SH FILES
905 .TP 15
906 .NOP \fI/etc/ntp.conf\f[]
907 the default name of the configuration file
908 .br
909 .ns
910 .TP 15
911 .NOP \fI/etc/ntp.drift\f[]
912 the default name of the drift file
913 .br
914 .ns
915 .TP 15
916 .NOP \fI/etc/ntp.keys\f[]
917 the default name of the key file
918 .PP
919 .SH "EXIT STATUS"
920 One of the following exit values will be returned:
921 .TP
922 .NOP 0 " (EXIT_SUCCESS)"
923 Successful program execution.
924 .TP
925 .NOP 1 " (EXIT_FAILURE)"
926 The operation failed or the command syntax was not valid.
927 .TP
928 .NOP 70 " (EX_SOFTWARE)"
929 libopts had an internal operational error. Please report
930 it to autogen-users (a] lists.sourceforge.net. Thank you.
931 .PP
932 .SH "SEE ALSO"
933 \fCntp.conf\fR(5)\f[],
934 \fCntpdate\fR(1ntpdatemdoc)\f[],
935 \fCntpdc\fR(1ntpdcmdoc)\f[],
936 \fCntpq\fR(1ntpqmdoc)\f[]
937 .sp \n(Ppu
938 .ne 2
939
940 In addition to the manual pages provided,
941 comprehensive documentation is available on the world wide web
942 at
943 \f[C]http://www.ntp.org/\f[].
944 A snapshot of this documentation is available in HTML format in
945 \fI/usr/share/doc/ntp\f[].
946 David L. Mills,
947 \fINetwork Time Protocol (Version 1)\fR,
948 RFC1059
949 .PP
950
951 David L. Mills,
952 \fINetwork Time Protocol (Version 2)\fR,
953 RFC1119
954 .PP
955
956 David L. Mills,
957 \fINetwork Time Protocol (Version 3)\fR,
958 RFC1305
959 .PP
960
961 David L. Mills and J. Martin, Ed. and J. Burbank and W. Kasch,
962 \fINetwork Time Protocol Version 4: Protocol and Algorithms Specification\fR,
963 RFC5905
964 .PP
965
966 David L. Mills and B. Haberman, Ed.,
967 \fINetwork Time Protocol Version 4: Autokey Specification\fR,
968 RFC5906
969 .PP
970
971 H. Gerstung and C. Elliott and B. Haberman, Ed.,
972 \fIDefinitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)\fR,
973 RFC5907
974 .PP
975
976 R. Gayraud and B. Lourdelet,
977 \fINetwork Time Protocol (NTP) Server Option for DHCPv6\fR,
978 RFC5908
979 .PP
980
981 .SH "AUTHORS"
982 The University of Delaware
983 .SH "COPYRIGHT"
984 Copyright (C) 1970-2013 The University of Delaware all rights reserved.
985 This program is released under the terms of the NTP license, <http://ntp.org/license>.
986 .SH BUGS
987 The
988 \f\*[B-Font]ntpd\fP
989 utility has gotten rather fat.
990 While not huge, it has gotten
991 larger than might be desirable for an elevated-priority
992 \f\*[B-Font]ntpd\fP
993 running on a workstation, particularly since many of
994 the fancy features which consume the space were designed more with
995 a busy primary server, rather than a high stratum workstation in
996 mind.
997 .sp \n(Ppu
998 .ne 2
999
1000 Please send bug reports to: http://bugs.ntp.org, bugs (a] ntp.org
1001 .SH NOTES
1002 This document corresponds to version 4.2.7p404 of NTP.
1003 Portions of this document came from FreeBSD.
1004 .sp \n(Ppu
1005 .ne 2
1006
1007 This manual page was \fIAutoGen\fP-erated from the \fBntpd\fP
1008 option definitions.
1009