NetBSD/dist/ntp/html/ntpd.htm

191 lines
7.9 KiB
HTML

<HTML><HEAD><TITLE>
<TT>ntpd</TT> - Network Time Protocol (NTP) daemon
</TITLE></HEAD><BODY><H3>
<TT>ntpd</TT> - Network Time Protocol (NTP) daemon
</H3><HR>
<H4>Synopsis</H4>
<TT>ntpd [ -aAbdm ] [ -c <I>conffile</I> ] [ -f <I>driftfile</I> ] [ -g
] [ -i <I>chrootdir</I> ] [ -k <I>keyfile</I> ] [ -l <I>logfile</I> ]
[ -p <I>pidfile</I> ] [ -r <I>broadcastdelay</I> ] [ -s <I>statsdir</I> ]
[ -t <I>key</I> ] [ -u user[:group] ] [ -v <I>variable</I> ]
[ -V <I>variable</I> ] [ -x ]</TT>
<H4>Description</H4>
<TT>ntpd</TT> is an operating system daemon which sets and maintains the
system time-of-day in synchronism with Internet standard time servers.
<TT>ntpd</TT> is a complete implementation of the Network Time Protocol
(NTP) version 4, but also retains compatibility with version 3, as
defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and
RFC-1119, respectively. <TT>ntpd</TT> does most computations in 64-bit
floating point arithmetic and does relatively clumsy 64-bit fixed point
operations only when necessary to preserve the ultimate precision,
about 232 picoseconds. While the ultimate precision is not achievable
with ordinary workstations and networks of today, it may be required
with future nanosecond CPU clocks and gigabit LANs.
<P>The daemon can operate in any of several modes, including symmetric
active/passive, client/server broadcast/multicast and manycast. A
broadcast/multicast or manycast client can discover remote servers,
compute server-client propagation delay correction factors and configure
itself automatically. This makes it possible to deploy a fleet of
workstations without specifying configuration details specific to the
local environment.
<P>Ordinarily, <TT>ntpd</TT> reads the <TT>ntp.conf</TT> configuration
file at startup time in order to determine the synchronization sources
and operating modes. It is also possible to specify a working, although
limited, configuration entirely on the command line, obviating the need
for a configuration file. This may be particularly appropriate when the
local host is to be configured as a broadcast/multicast client or
manycast client, with all peers being determined by listening to
broadcasts at run time.
<P>If NetInfo support is built into <TT>ntpd</TT>, then <TT>ntpd</TT>
will attempt to read its configuration from the NetInfo if the default
ntp.conf file cannot be read and no file is specified by the <TT>-c</TT>
option.
<P>Various internal <TT>ntpd</TT> variables can be displayed and
configuration options altered while the daemon is running using the
<TT><A HREF="ntpq.htm">ntpq</A></TT> and <TT><A
HREF="ntpdc.htm">ntpdc</A></TT> utility programs.
<P>When <TT>ntpd</TT> starts it looks at the value of <TT>umask</TT>,
and if it's zero <TT>ntpd</TT> will set the <TT>umask</TT> to
<TT>022</TT>.
<H4>Command Line Options</H4>
<DL>
<DT><TT>-a</TT></DT>
<DD>Enable authentication mode (default).</DD>
<DT><TT>-A</TT></DT>
<DD>Disable authentication mode.</DD>
<DT><TT>-b</TT></DT>
<DD>Synchronize using NTP broadcast messages.</DD>
<DT><TT>-c <I>conffile</I></TT></DT>
<DD>Specify the name and path of the configuration file.</DD>
<DT><TT>-d</TT></DT>
<DD>Specify debugging mode. This flag may occur multiple times, with
each occurrence indicating greater detail of display.</DD>
<DT><TT>-D <I>level</I></TT></DT>
<DD>Specify debugging level directly.</DD>
<DT><TT>-f <I>driftfile</I></TT></DT>
<DD>Specify the name and path of the drift file.</DD>
<DT><TT>-g</TT></DT>
<DD>Normally, the daemon exits if the offset exceeds a 1000-s sanity
limit. This option overrides this limit and allows the time to be set to
any value without restriction; however, this can happen only once. After
that, the daemon will exit if the limit is exceeded.</DD>
<DT><TT>-i <I>chrootdir</I></TT></DT>
<DD>Specify the path to a directory in which ntpd will run chrooted.</DD>
<DT><TT>-k <I>keyfile</I></TT></DT>
<DD>Specify the name and path of the file containing the NTP
authentication keys.</DD>
<DT><TT>-l <I>logfile</I></TT></DT>
<DD>Specify the name and path of the log file. The default is the system
log facility.</DD>
<DT><TT>-m</TT></DT>
<DD>Synchronize using NTP multicast messages on the IP multicast group
address 224.0.1.1 (requires multicast kernel).</DD>
<DT><TT>-p <I>pidfile</I></TT></DT>
<DD>Specify the name and path to record the daemon's process ID.</DD>
<DT><TT>-P</TT></DT>
<DD>Override the priority limit set by the operating system. Not
recommended for sissies.</DD>
<DT><TT>-r <I>broadcastdelay</I></TT></DT>
<DD>Specify the default propagation delay from the broadcast/multicast
server and this computer. This is necessary only if the delay cannot be
computed automatically by the protocol.</DD>
<DT><TT>-s <I>statsdir</I></TT></DT>
<DD>Specify the directory path for files created by the statistics
facility.</DD>
<DT><TT>-t <I>key</I></TT></DT>
<DD>Add a key number to the trusted key list.</DD>
<DT><TT>-u <I>user[:group]</I></TT></DT>
<DD>Specify user (and optionally group) as which ntpd will run.</DD>
<DT><TT>-v <I>variable</I></TT></DT>
<DT><TT>-V <I>variable</I></TT></DT>
<DD>Add a system variable listed by default.</DD>
<DT><TT>-x</TT></DT>
<DD>Ordinarily, if the time is to be adjusted more than 128 ms, it is
stepped, not gradually slewed. This option forces the time to be slewed
in all cases. Note: Since the slew rate is limited to 0.5 ms/s, each
second of adjustment requires an amortization interval of 2000 s. Thus,
an adjustment of many seconds can take hours or days to amortize.</DD>
</DL>
<H4>The Configuration File</H4>
The <TT>ntpd</TT> configuration file is read at initial startup in order
to specify the synchronization sources, modes and other related
information. Usually, it is installed in the <TT>/etc</TT> directory,
but could be installed elsewhere (see the <TT>-c <I>conffile</I></TT>
command line option). The file format is similar to other Unix
configuration files - comments begin with a <TT>#</TT> character and
extend to the end of the line; blank lines are ignored. Configuration
commands consist of an initial keyword followed by a list of arguments,
some of which may be optional, separated by whitespace. Commands may not
be continued over multiple lines. Arguments may be host names, host
addresses written in numeric, dotted-quad form, integers, floating
point numbers (when specifying times in seconds) and text strings.
Optional arguments are delimited by <TT>[ ]</TT> in the following
descriptions, while alternatives are separated by <TT>|</TT>. The
notation <TT>[ ... ]</TT> means an optional, indefinite repetition of
the last item before the <TT>[ ... ]</TT>.
<P>See the following pages for configuration and control options. While
there is a rich set of options available, the only required option is
one or more <TT>server, peer,</TT> <TT>broadcast</TT> or
<TT>manycastclient </TT>commands described in the Configuration Options
page. The <A HREF="notes.htm">Notes on Configuring NTP and Setting up a
NTP Subnet </A>page contains an extended discussion of these options.
<P><A HREF="confopt.htm">Configuration Options</A>
<BR><A HREF="authopt.htm">Authentication Options</A>
<BR><A HREF="monopt.htm">Monitoring Options</A>
<BR><A HREF="accopt.htm">Access Control Options</A>
<BR><A HREF="clockopt.htm">Reference Clock Options</A>
<BR><A HREF="miscopt.htm">Miscellaneous Options</A>
<H4>Files</H4>
<TT>/etc/ntp.conf</TT> - the default name of the configuration file
<BR><TT>/etc/ntp.drift</TT> - the default name of the drift file
<BR><TT>/etc/ntp.keys</TT> - the default name of the key file
<H4>Bugs</H4>
<TT>ntpd</TT> has gotten rather fat. While not huge, it has gotten
larger than might be desirable for an elevated-priority daemon running
on a workstation, particularly since many of the fancy features which
consume the space were designed more with a busy primary server, rather
than a high stratum workstation, in mind.
<hr><a href=index.htm>Home</a><address><a
href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
</address></a></body></html>