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