Update documentation

This commit is contained in:
Miroslav Lichvar 2013-06-20 18:00:32 +02:00
parent 821226e473
commit fa409ddc8f
6 changed files with 63 additions and 128 deletions

12
INSTALL
View file

@ -81,12 +81,14 @@ Now that the software is successfully installed, the next step is to
set up a configuration file. The contents of this depend on the set up a configuration file. The contents of this depend on the
network environment in which the computer operates. Typical scenarios network environment in which the computer operates. Typical scenarios
are described in the manual. The simplest case is for a computer with are described in the manual. The simplest case is for a computer with
a permanent Internet connection - suppose you want to use the NTP a permanent Internet connection - suppose you want to use public NTP
server ntp1.foobar.com as your time reference. You would create an servers from the pool.ntp.org project as your time reference. You would
/etc/chrony.conf file containing create an /etc/chrony.conf file containing
server ntp1.foobar.com server 0.pool.ntp.org
driftfile /etc/chrony.drift server 1.pool.ntp.org
server 2.pool.ntp.org
driftfile /var/lib/chrony/drift
and then run /usr/local/sbin/chronyd. and then run /usr/local/sbin/chronyd.

19
README
View file

@ -21,12 +21,12 @@ between measurements from the reference.
The reference time can be derived from Network Time Protocol (NTP) The reference time can be derived from Network Time Protocol (NTP)
servers, reference clocks, or wristwatch-and-keyboard (via chronyc). servers, reference clocks, or wristwatch-and-keyboard (via chronyc).
The main source of information about the Network Time Protocol is The main source of information about the Network Time Protocol is
http://www.eecis.udel.edu/~ntp. http://www.ntp.org.
It is designed so that it can work on computers which only have It is designed so that it can work on computers which only have
intermittent access to reference sources, for example computers which intermittent access to reference sources, for example computers which
use a dial-up account to access the Internet. Of course, it will work use a dial-up account to access the Internet or laptops. Of course, it
on computers with permanent connections too. will work well on computers with permanent connections too.
In addition, on Linux it can monitor the system's real time clock In addition, on Linux it can monitor the system's real time clock
performance, so the system can maintain accurate time even across performance, so the system can maintain accurate time even across
@ -48,10 +48,7 @@ What will chrony run on?
Chrony can be successfully built and run on Chrony can be successfully built and run on
1. Linux v1.2.13, v2.0.x, 2.1.x (partially), 2.2.x, 2.3.x, 2.4.x, 2.6.x. 1. Linux 2.2.x, 2.3.x, 2.4.x, 2.6.x, 3.x
Real time clock support is limited to 2.0.32 onwards and to 2.2, 2.3,
2.4 and 2.6 series only. i386, x86_64, PowerPC are known to be
supported.
2. Solaris 2.5/2.5.1/2.6/2.7/2.8 (various platforms) 2. Solaris 2.5/2.5.1/2.6/2.7/2.8 (various platforms)
@ -88,12 +85,6 @@ through the URL
http://chrony.tuxfamily.org/ http://chrony.tuxfamily.org/
What can chrony not do?
=======================
Compared to the `reference' RFC1305 implementation xntpd, chronyd does
not support broadcast modes.
Where are new versions announced? Where are new versions announced?
================================= =================================
@ -252,5 +243,3 @@ Doug Woodward <dougw@whistler.com>
Many other people have contributed bug reports and suggestions. I'm Many other people have contributed bug reports and suggestions. I'm
sorry I can't identify all of you individually. sorry I can't identify all of you individually.
vim:tw=72

View file

@ -32,16 +32,16 @@ between measurements from the reference.
The reference time can be derived from either Network Time Protocol The reference time can be derived from either Network Time Protocol
(NTP) servers, reference clocks, or wristwatch-and-keyboard (via \fIchronyc\fR). (NTP) servers, reference clocks, or wristwatch-and-keyboard (via \fIchronyc\fR).
The main source of information about the Network Time Protocol is The main source of information about the Network Time Protocol is
\fIhttp://www.eecis.udel.edu/~ntp\fR. \fIhttp://www.ntp.org\fR.
It is designed so that it can work on computers which only have It is designed so that it can work on computers which only have
intermittent access to reference sources, for example computers which intermittent access to reference sources, for example computers which
use a dial-up account to access the Internet. Of course, it will work use a dial-up account to access the Internet or laptops. Of course, it
on computers with permanent connections too. will work well on computers with permanent connections too.
In addition, for Linux 2.0.x (for x >= 32) or 2.2 onwards, chronyd can monitor In addition, on Linux it can monitor the system's real time clock
the system's real time clock performance, so the system can maintain accurate performance, so the system can maintain accurate time even across
time even across reboots. reboots.
Typical accuracies available between 2 machines are Typical accuracies available between 2 machines are

View file

@ -31,7 +31,7 @@ useful configuration file would look something like
server g.h.i server g.h.i
keyfile @SYSCONFDIR@/chrony.keys keyfile @SYSCONFDIR@/chrony.keys
commandkey 1 commandkey 1
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
.SH "SEE ALSO" .SH "SEE ALSO"

View file

@ -570,6 +570,9 @@ customers.
stratum 1 and stratum 2 servers. You should find one or more servers stratum 1 and stratum 2 servers. You should find one or more servers
that are near to you --- check that their access policy allows you to that are near to you --- check that their access policy allows you to
use their facilities. use their facilities.
@item Use public servers from
@uref{http://www.pool.ntp.org/, the pool.ntp.org project}.
@end itemize @end itemize
Assuming that you have found some servers, you need to set up a Assuming that you have found some servers, you need to set up a
@ -595,7 +598,7 @@ server d.e.f
server g.h.i server g.h.i
keyfile @SYSCONFDIR@/chrony.keys keyfile @SYSCONFDIR@/chrony.keys
commandkey 1 commandkey 1
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
@end example @end example
@c }}} @c }}}
@c {{{ S:Infrequent connection @c {{{ S:Infrequent connection
@ -629,38 +632,24 @@ server d.e.f
server g.h.i server g.h.i
@end example @end example
However, the following issues need to be addressed: However, your computer will keep trying to contact the servers to obtain
@enumerate 1
@item
Your computer probably doesn't have DNS access whilst offline to turn
the machine names into IP addresses.
@item
Your computer will keep trying to contact the servers to obtain
timestamps, even whilst offline. If you operate a dial-on-demand timestamps, even whilst offline. If you operate a dial-on-demand
system, things are even worse, because the link to the internet will system, things are even worse, because the link to the internet will
keep getting established. keep getting established.
@end enumerate
For this reason, it would be better to specify this part of your For this reason, it would be better to specify this part of your
configuration file in the following way: configuration file in the following way:
@example @example
server 1.2.3.4 offline server a.b.c offline
server 5.6.7.8 offline server d.e.f offline
server 9.10.11.12 offline server g.h.i offline
@end example @end example
Because numeric IP addresses have been used, the first problem is The @code{offline} keyword indicates that the servers start
overcome. The @code{offline} keyword indicates that the servers start
in an offline state, and that they should not be contacted until @code{chronyd} in an offline state, and that they should not be contacted until @code{chronyd}
receives notification that the link to the internet is present. receives notification that the link to the internet is present.
An alternative is to use the names of the NTP servers, and put entries for them
into your @file{/etc/hosts} file. This will be OK as long as @samp{files}
comes before @samp{dns} in the @samp{hosts} line of the
@file{/etc/nsswitch.conf} file.
In order to notify @code{chronyd} of the presence of the link, you will need to In order to notify @code{chronyd} of the presence of the link, you will need to
be able to log in to it with the program chronyc. To do this, @code{chronyd} be able to log in to it with the program chronyc. To do this, @code{chronyd}
needs to be configured with an administrator password. To set up an needs to be configured with an administrator password. To set up an
@ -668,7 +657,7 @@ administrator password, you can create a file @file{@SYSCONFDIR@/chrony.keys}
containing a single line containing a single line
@example @example
1 xyzzy 1 ALongAndRandomPassword
@end example @end example
and add the following line to @file{@SYSCONFDIR@/chrony.conf} (the order of the and add the following line to @file{@SYSCONFDIR@/chrony.conf} (the order of the
@ -681,12 +670,12 @@ commandkey 1
The smallest useful configuration file would look something like The smallest useful configuration file would look something like
@example @example
server 1.2.3.4 offline server a.b.c offline
server 5.6.7.8 offline server d.e.f offline
server 9.10.11.12 offline server g.h.i offline
keyfile @SYSCONFDIR@/chrony.keys keyfile @SYSCONFDIR@/chrony.keys
commandkey 1 commandkey 1
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
@end example @end example
The next section describes how to tell @code{chronyd} when the internet link The next section describes how to tell @code{chronyd} when the internet link
@ -750,7 +739,7 @@ be (assuming the clients are in the 192.168.165.x subnet and that the
master's address is 192.168.169.170) master's address is 192.168.169.170)
@example @example
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
commandkey 25 commandkey 25
keyfile @SYSCONFDIR@/chrony.keys keyfile @SYSCONFDIR@/chrony.keys
initstepslew 10 client1 client3 client6 initstepslew 10 client1 client3 client6
@ -764,7 +753,7 @@ the configuration file might be
@example @example
server master server master
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
logdir /var/log/chrony logdir /var/log/chrony
log measurements statistics tracking log measurements statistics tracking
keyfile @SYSCONFDIR@/chrony.keys keyfile @SYSCONFDIR@/chrony.keys
@ -900,34 +889,24 @@ To illustrate how a dial-up home computer might be configured, example
configuration files are shown in this section. configuration files are shown in this section.
For the @file{@SYSCONFDIR@/chrony.conf} file, the following can be used as an For the @file{@SYSCONFDIR@/chrony.conf} file, the following can be used as an
example. @emph{NOTE : The @code{server} directives are only applicable example.
to customers of Demon Internet; users of other ISPs will need to use
their own ISP's NTP servers or public NTP servers.}
@example @example
server 158.152.1.65 minpoll 5 maxpoll 10 maxdelay 0.4 offline server 0.pool.ntp.org minpoll 5 maxpoll 10 maxdelay 0.4 offline
server 158.152.1.76 minpoll 5 maxpoll 10 maxdelay 0.4 offline server 1.pool.ntp.org minpoll 5 maxpoll 10 maxdelay 0.4 offline
server 194.159.253.2 minpoll 5 maxpoll 10 maxdelay 0.4 offline server 2.pool.ntp.org minpoll 5 maxpoll 10 maxdelay 0.4 offline
logdir /var/log/chrony logdir /var/log/chrony
log statistics measurements tracking log statistics measurements tracking
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
keyfile @SYSCONFDIR@/chrony.keys keyfile @SYSCONFDIR@/chrony.keys
commandkey 25 commandkey 25
maxupdateskew 100.0 maxupdateskew 100.0
dumponexit dumponexit
dumpdir /var/log/chrony dumpdir @CHRONYVARDIR@
rtcfile @SYSCONFDIR@/chrony.rtc rtcfile @CHRONYVARDIR@/rtc
@end example @end example
With Freeserve as the ISP, the following server lines can be used: @code{pppd} is used for connecting to the internet. This runs two scripts
@example
server 194.152.64.68 minpoll 5 maxpoll 10 maxdelay 0.4 offline
server 194.152.64.35 minpoll 5 maxpoll 10 maxdelay 0.4 offline
server 194.152.64.34 minpoll 5 maxpoll 10 maxdelay 0.4 offline
@end example
@code{pppd} is used for connecting to my ISP. This runs two scripts
@file{/etc/ppp/ip-up} and @file{/etc/ppp/ip-down} when the link goes @file{/etc/ppp/ip-up} and @file{/etc/ppp/ip-down} when the link goes
online and offline respectively. online and offline respectively.
@ -940,17 +919,9 @@ The relevant part of the @file{/etc/ppp/ip-up} file is
and the relevant part of the @file{/etc/ppp/ip-down} script is and the relevant part of the @file{/etc/ppp/ip-down} script is
@example @example
@BINDIR@/chronyc -a <<EOF @BINDIR@/chronyc -a -m offline dump writertc
offline
dump
writertc
EOF
@end example @end example
(Because they have to contain the administrator password, it would be
desirable to make the files readable only by root on a multiuser
machine).
To start @code{chronyd} during the boot sequence, the following To start @code{chronyd} during the boot sequence, the following
is in @file{/etc/rc.d/rc.local} (this is a Slackware system) is in @file{/etc/rc.d/rc.local} (this is a Slackware system)
@ -962,34 +933,13 @@ fi
@end example @end example
The placement of this command may be important on some systems. In The placement of this command may be important on some systems. In
particular, @code{chronyd} may need to be started several seconds (about particular, @code{chronyd} may need to be started before any software
10 as a minimum) before any software that depends on the system clock that depends on the system clock not jumping or moving backwards,
not jumping or moving backwards, depending on the directives in depending on the directives in @code{chronyd's} configuration file.
@code{chronyd's} configuration file.
For the system shutdown, @code{chronyd} should receive a SIGTERM several For the system shutdown, @code{chronyd} should receive a SIGTERM several
seconds before the final SIGKILL; the SIGTERM causes the measurement seconds before the final SIGKILL; the SIGTERM causes the measurement
histories and RTC information to be saved out. There should be no need histories and RTC information to be saved out.
to add anything to the shutdown sequence, unless (as my system had)
there is no pause between the SIGTERM and SIGKILL being delivered to the
remaining processes. So if you find something like
@example
killall5 -15
killall5 -9
@end example
in your @code{/etc/rc.d/rc.0} script, you will need to insert a sleep, e.g.
@example
killall5 -15
sleep 5
killall5 -9
@end example
Otherwise, @code{chronyd} will not always save information on shutdown,
which could be a problem if you don't use @code{dump} and
@code{writertc} when you go offline.
@c }}} @c }}}
@c {{{ S:Other config options @c {{{ S:Other config options
@node Configuration options overview @node Configuration options overview
@ -1007,11 +957,11 @@ determination is taking place.
To avoid this problem, @code{chronyd} allows the gain or loss rate to be To avoid this problem, @code{chronyd} allows the gain or loss rate to be
stored in a file, which can be read back in when the program is stored in a file, which can be read back in when the program is
restarted. This file is called the drift file, and might typically be restarted. This file is called the drift file, and might typically be
stored in @file{@SYSCONFDIR@/chrony.drift}. By specifying an option like the stored in @file{@CHRONYVARDIR@/drift}. By specifying an option like the
following following
@example @example
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
@end example @end example
in the configuration file (@file{@SYSCONFDIR@/chrony.conf}), the drift file in the configuration file (@file{@SYSCONFDIR@/chrony.conf}), the drift file
@ -1117,7 +1067,7 @@ IPv6 sockets will be created.
On systems that support an @file{/etc/rc.local} file for starting On systems that support an @file{/etc/rc.local} file for starting
programs at boot time, @code{chronyd} can be started from there. programs at boot time, @code{chronyd} can be started from there.
On systems with a System V style initialisation (e.g. Solaris), a On systems with a System V style initialisation, a
suitable start/stop script might be as shown below. This might be suitable start/stop script might be as shown below. This might be
placed in the file @file{/etc/rc2.d/S83chrony}. placed in the file @file{/etc/rc2.d/S83chrony}.
@ -1422,7 +1372,7 @@ chronyd is running.
You can have more than 1 @code{broadcast} directive if you have more than 1 You can have more than 1 @code{broadcast} directive if you have more than 1
network interface onto which you wish to send NTP broadcast packets. network interface onto which you wish to send NTP broadcast packets.
Chronyd itself cannot currently act as a broadcast client; it must always be @code{chronyd} itself cannot currently act as a broadcast client; it must always be
configured as a point-to-point client by defining specific NTP servers and configured as a point-to-point client by defining specific NTP servers and
peers. This broadcast server feature is intended for providing a time source peers. This broadcast server feature is intended for providing a time source
to other NTP software (e.g. various MS Windows clients). to other NTP software (e.g. various MS Windows clients).
@ -1608,7 +1558,7 @@ which the true rate actually lies.
An example of the driftfile command is An example of the driftfile command is
@example @example
driftfile @SYSCONFDIR@/chrony.drift driftfile @CHRONYVARDIR@/drift
@end example @end example
@c }}} @c }}}
@c {{{ dumpdir @c {{{ dumpdir
@ -1634,12 +1584,12 @@ directory where the measurement histories are saved.
An example of the command is An example of the command is
@example @example
dumpdir /var/log/chrony dumpdir @CHRONYVARDIR@
@end example @end example
A source whose reference id (the IP address for IPv4 sources) is A source whose reference id (the IP address for IPv4 sources) is
1.2.3.4 would have its measurement history saved in the file 1.2.3.4 would have its measurement history saved in the file
@file{/var/log/chrony/1.2.3.4.dat}. @file{/var/lib/chrony/1.2.3.4.dat}.
@c }}} @c }}}
@c {{{ dumponexit @c {{{ dumponexit
@node dumponexit directive @node dumponexit directive
@ -2670,7 +2620,7 @@ of the system's real-time clock (RTC).
The syntax is illustrated in the following example The syntax is illustrated in the following example
@example @example
rtcfile @SYSCONFDIR@/chrony.rtc rtcfile @CHRONYVARDIR@/rtc
@end example @end example
@code{chronyd} saves information in this file when it exits and when the @code{chronyd} saves information in this file when it exits and when the
@ -2741,12 +2691,12 @@ This mode is supported only on Linux.
This directive uses the Linux sched_setscheduler() system call to This directive uses the Linux sched_setscheduler() system call to
instruct the kernel to use the SCHED_FIFO first-in, first-out instruct the kernel to use the SCHED_FIFO first-in, first-out
real-time scheduling policy for Chronyd with the specified priority. real-time scheduling policy for @code{chronyd} with the specified priority.
This means that whenever Chronyd is ready to run it will run, This means that whenever @code{chronyd} is ready to run it will run,
interrupting whatever else is running unless it is a higher priority interrupting whatever else is running unless it is a higher priority
real-time process. This should not impact performance as Chronyd's real-time process. This should not impact performance as @code{chronyd's}
resource requirements are modest, but it should result in lower and resource requirements are modest, but it should result in lower and
more consistent latency since Chronyd will not need to wait for the more consistent latency since @code{chronyd} will not need to wait for the
scheduler to get around to running it. You should not use this unless scheduler to get around to running it. You should not use this unless
you really need it. The sched_setscheduler man page has more details. you really need it. The sched_setscheduler man page has more details.
@c }}} @c }}}
@ -2776,10 +2726,10 @@ ignore stratum when selecting the source.
The @code{lock_all} directive will lock chronyd into RAM so that it The @code{lock_all} directive will lock chronyd into RAM so that it
will never be paged out. This mode is only supported on Linux. This will never be paged out. This mode is only supported on Linux. This
directive uses the Linux mlockall() system call to prevent Chronyd directive uses the Linux mlockall() system call to prevent @code{chronyd}
from ever being swapped out. This should result in lower and more from ever being swapped out. This should result in lower and more
consistent latency. It should not have significant impact on consistent latency. It should not have significant impact on
performance as Chronyd's memory usage is modest. The mlockall man performance as @code{chronyd's} memory usage is modest. The mlockall man
page has more details. page has more details.
@c }}} @c }}}
@c {{{ server @c {{{ server
@ -3472,12 +3422,7 @@ periodically purged. An example of how to do this is shown below.
@example @example
% mv /var/log/chrony/measurements.log /var/log/chrony/measurements1.log % mv /var/log/chrony/measurements.log /var/log/chrony/measurements1.log
% chronyc % chronyc -a cyclelogs
chronyc> password aardvark
200 OK
chronyc> cyclelogs
200 OK
chronyc> exit
% ls -l /var/log/chrony % ls -l /var/log/chrony
-rw-r--r-- 1 root root 0 Jun 8 18:17 measurements.log -rw-r--r-- 1 root root 0 Jun 8 18:17 measurements.log
-rw-r--r-- 1 root root 12345 Jun 8 18:17 measurements1.log -rw-r--r-- 1 root root 12345 Jun 8 18:17 measurements1.log

View file

@ -125,8 +125,7 @@ from \fIhttp://go.to/chrony\fR
.BR chrony(1), .BR chrony(1),
.BR chronyc(1), .BR chronyc(1),
.BR chrony.conf(5), .BR chrony.conf(5),
.BR clock(8), .BR hwclock(8),
.BR xntpd(8),
.BR ntpd(8) .BR ntpd(8)
.SH AUTHOR .SH AUTHOR