Assuming that you have found some servers, you need to set up a
configuration file to run chrony. The (compiled-in) default location
-for this file is @file{/etc/chrony.conf}. Assuming that your ntp
+for this file is @file{@SYSCONFDIR@/chrony.conf}. Assuming that your ntp
servers are called @code{a.b.c} and @code{d.e.f}, your
@file{chrony.conf} file could contain as a minimum
server a.b.c
server d.e.f
server g.h.i
-keyfile /etc/chrony.keys
+keyfile @SYSCONFDIR@/chrony.keys
commandkey 1
-driftfile /etc/chrony.drift
+driftfile @SYSCONFDIR@/chrony.drift
@end example
@c }}}
@c {{{ S:Infrequent connection
have occasional connections to the internet.
@menu
-* Configuration for infrequent connections:: How to set up the @code{/etc/chrony} file
+* Configuration for infrequent connections:: How to set up the @code{@SYSCONFDIR@/chrony.conf} file
* Advising chronyd of internet availability:: How to tell chronyd when the link is available
@end menu
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}
needs to be configured with an administrator password. To set up an
-administrator password, you can create a file @file{/etc/chrony.keys}
+administrator password, you can create a file @file{@SYSCONFDIR@/chrony.keys}
containing a single line
@example
1 xyzzy
@end example
-and add the following line to @file{/etc/chrony.conf} (the order of the
+and add the following line to @file{@SYSCONFDIR@/chrony.conf} (the order of the
lines does not matter)
@example
server 1.2.3.4 offline
server 5.6.7.8 offline
server 9.10.11.12 offline
-keyfile /etc/chrony.keys
+keyfile @SYSCONFDIR@/chrony.keys
commandkey 1
-driftfile /etc/chrony.drift
+driftfile @SYSCONFDIR@/chrony.drift
@end example
The next section describes how to tell @code{chronyd} when the internet link
@node Advising chronyd of internet availability
@subsection How to tell chronyd when the internet link is available.
To use this option, you will need to configure a command key in
-@code{chronyd's} configuration file @file{/etc/chrony.conf}, as described in
+@code{chronyd's} configuration file @file{@SYSCONFDIR@/chrony.conf}, as described in
the previous section.
To tell @code{chronyd} when to start and finish sampling the servers, the
@code{online} and @code{offline} commands of chronyc need to be used.
To give an example of their use, we assume that @code{pppd} is the
program being used to connect to the internet, and that chronyc has been
-installed at its default location @file{/usr/local/bin/chronyc}. We
+installed at its default location @file{@BINDIR@/chronyc}. We
also assume that the command key has been set up as described in the
previous section.
In the file @file{/etc/ppp/ip-up} we add the command sequence
@example
-/usr/local/bin/chronyc -a online
+@BINDIR@/chronyc -a online
@end example
and in the file @file{/etc/ppp/ip-down} we add the sequence
@example
-/usr/local/bin/chronyc -a offline
+@BINDIR@/chronyc -a offline
@end example
@code{chronyd's} polling of the servers will now only occur whilst the
master's address is 192.168.169.170)
@example
-driftfile /etc/chrony.drift
+driftfile @SYSCONFDIR@/chrony.drift
commandkey 25
-keyfile /etc/chrony.keys
+keyfile @SYSCONFDIR@/chrony.keys
initstepslew 10 client1 client3 client6
local stratum 8
manual
@example
server master
-driftfile /etc/chrony.drift
+driftfile @SYSCONFDIR@/chrony.drift
logdir /var/log/chrony
log measurements statistics tracking
-keyfile /etc/chrony.keys
+keyfile @SYSCONFDIR@/chrony.keys
commandkey 24
local stratum 10
initstepslew 20 master
To illustrate how a dial-up home computer might be configured, example
configuration files are shown in this section.
-For the @file{/etc/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
to customers of Demon Internet; users of other ISPs will need to use
their own ISP's NTP servers or public NTP servers.}
server 194.159.253.2 minpoll 5 maxpoll 10 maxdelay 0.4 offline
logdir /var/log/chrony
log statistics measurements tracking
-driftfile /etc/chrony.drift
-keyfile /etc/chrony.keys
+driftfile @SYSCONFDIR@/chrony.drift
+keyfile @SYSCONFDIR@/chrony.keys
commandkey 25
maxupdateskew 100.0
dumponexit
dumpdir /var/log/chrony
-rtcfile /etc/chrony.rtc
+rtcfile @SYSCONFDIR@/chrony.rtc
@end example
With Freeserve as the ISP, I use the following server lines :
The relevant part of the @file{/etc/ppp/ip-up} file is
@example
-/usr/local/bin/chronyc -a online
+@BINDIR@/chronyc -a online
@end example
and the relevant part of the @file{/etc/ppp/ip-down} script is
@example
-/usr/local/bin/chronyc -a <<EOF
+@BINDIR@/chronyc -a <<EOF
offline
dump
writertc
in @file{/etc/rc.d/rc.local} (this is a Slackware system)
@example
-if [ -f /usr/local/sbin/chronyd -a -f /etc/chrony.conf ]; then
- /usr/local/sbin/chronyd -r -s
+if [ -f @SBINDIR@/chronyd -a -f @SYSCONFDIR@/chrony.conf ]; then
+ @SBINDIR@/chronyd -r -s
echo "Start chronyd"
fi
@end example
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
restarted. This file is called the drift file, and might typically be
-stored in @file{/etc/chrony.drift}. By specifying an option like the
+stored in @file{@SYSCONFDIR@/chrony.drift}. By specifying an option like the
following
@example
-driftfile /etc/chrony.drift
+driftfile @SYSCONFDIR@/chrony.drift
@end example
-in the configuration file (@file{/etc/chrony.conf}), the drift file
+in the configuration file (@file{@SYSCONFDIR@/chrony.conf}), the drift file
facility will be activated.
@c }}}
@c }}}
@node Starting chronyd
@section Starting chronyd
If @code{chronyd} has been installed to its default location
-@file{/usr/local/sbin/chronyd}, starting it is simply a matter of
+@file{@SBINDIR@/chronyd}, starting it is simply a matter of
entering the command
@example
-/usr/local/sbin/chronyd
+@SBINDIR@/chronyd
@end example
Information messages and warnings will be logged to syslog.
syslog.
@item -f <conf-file>
This option can be used to specify an alternate location for the
-configuration file (default @file{/etc/chrony.conf}).
+configuration file (default @file{@SYSCONFDIR@/chrony.conf}).
@item -r
This option will reload sample histories for each of the servers being
used. These histories are created by using the @code{dump} command in
case "$1" in
'start')
- if [ -f /opt/free/sbin/chronyd -a -f /etc/chrony.conf ]; then
+ if [ -f /opt/free/sbin/chronyd -a -f @SYSCONFDIR@/chrony.conf ]; then
/opt/free/sbin/chronyd
fi
;;
@node Configuration file
@section The chronyd configuration file
@c {{{ section top
-The configuration file is normally called @file{/etc/chrony.conf}; in
+The configuration file is normally called @file{@SYSCONFDIR@/chrony.conf}; in
fact, this is the compiled-in default. However, other locations can be
specified with a command line option.
An example of the driftfile command is
@example
-driftfile /etc/chrony.drift
+driftfile @SYSCONFDIR@/chrony.drift
@end example
@c }}}
@c {{{ dumpdir
keep the differences in a separate file.
@example
-include /etc/chrony/local.conf
+include @SYSCONFDIR@/chrony/local.conf
@end example
@c }}}
@c {{{ initstepslew
The format of the command is shown in the example below
@example
-keyfile /etc/chrony.keys
+keyfile @SYSCONFDIR@/chrony.keys
@end example
The argument is simply the name of the file containing the ID/key
The syntax is illustrated in the following example
@example
-rtcfile /etc/chrony.rtc
+rtcfile @SYSCONFDIR@/chrony.rtc
@end example
@code{chronyd} saves information in this file when it exits and when the
Each argument will be interpreted as a whole command.
@item -f <conf-file>
This option can be used to specify an alternate location of the @code{chronyd}
-configuration file (default @file{/etc/chrony.conf}). The configuration file is
+configuration file (default @file{@SYSCONFDIR@/chrony.conf}). The configuration file is
needed for the `-a' option.
@item -a
With this option @code{chronyc} will try to authenticate automatically on
@code{chronyc} is quite dangerous for the integrity of the target
system's clock performance. Having access to @code{chronyd} via chronyc is
more or less equivalent to being able to modify @code{chronyd's} configuration
-file (typically @file{/etc/chrony.conf}) and to restart @code{chronyd}.
+file (typically @file{@SYSCONFDIR@/chrony.conf}) and to restart @code{chronyd}.
Chronyc also provides a number of monitoring (as opposed to commanding)
commands, which will not affect the behaviour of @code{chronyd}. However, you
it means the computer is not synchronised to any external source and
that you have the `local' mode operating (via the @code{local} command
in @code{chronyc} (@pxref{local command}), or the @code{local} directive
-in the @file{/etc/chrony.conf} file (@pxref{local directive})).
+in the @file{@SYSCONFDIR@/chrony.conf} file (@pxref{local directive})).
@item Stratum
The stratum indicates how many hops away from a computer with an
add_def CHRONY_VERSION "\"DEVELOPMENT\""
fi
-sed -e "s%@EXTRA_OBJECTS@%${EXTRA_OBJECTS}%;\
- s%@CC@%${MYCC}%;\
- s%@CFLAGS@%${MYCFLAGS}%;\
- s%@CPPFLAGS@%${CPPFLAGS}%;\
- s%@LIBS@%${LIBS}%;\
- s%@LDFLAGS@%${MYLDFLAGS}%;\
- s%@EXTRA_LIBS@%${EXTRA_LIBS}%;\
- s%@EXTRA_CLI_LIBS@%${EXTRA_CLI_LIBS}%;\
- s%@READLINE_COMPILE@%${READLINE_COMPILE}%;\
- s%@READLINE_LINK@%${READLINE_LINK}%;\
- s%@HASH_OBJ@%${HASH_OBJ}%;\
- s%@HASH_LINK@%${HASH_LINK}%;\
- s%@HASH_COMPILE@%${HASH_COMPILE}%;\
- s%@SYSCONFDIR@%${SYSCONFDIR}%;\
- s%@BINDIR@%${BINDIR}%;\
- s%@SBINDIR@%${SBINDIR}%;\
- s%@DOCDIR@%${DOCDIR}%;\
- s%@MANDIR@%${MANDIR}%;\
- s%@INFODIR@%${INFODIR}%;"\
- < Makefile.in > Makefile
+for f in Makefile chrony.conf.5 chrony.texi chronyc.1 chronyd.8
+do
+ echo Creating $f
+ sed -e "s%@EXTRA_OBJECTS@%${EXTRA_OBJECTS}%;\
+ s%@CC@%${MYCC}%;\
+ s%@CFLAGS@%${MYCFLAGS}%;\
+ s%@CPPFLAGS@%${CPPFLAGS}%;\
+ s%@LIBS@%${LIBS}%;\
+ s%@LDFLAGS@%${MYLDFLAGS}%;\
+ s%@EXTRA_LIBS@%${EXTRA_LIBS}%;\
+ s%@EXTRA_CLI_LIBS@%${EXTRA_CLI_LIBS}%;\
+ s%@READLINE_COMPILE@%${READLINE_COMPILE}%;\
+ s%@READLINE_LINK@%${READLINE_LINK}%;\
+ s%@HASH_OBJ@%${HASH_OBJ}%;\
+ s%@HASH_LINK@%${HASH_LINK}%;\
+ s%@HASH_COMPILE@%${HASH_COMPILE}%;\
+ s%@SYSCONFDIR@%${SYSCONFDIR}%;\
+ s%@BINDIR@%${BINDIR}%;\
+ s%@SBINDIR@%${SBINDIR}%;\
+ s%@DOCDIR@%${DOCDIR}%;\
+ s%@MANDIR@%${MANDIR}%;\
+ s%@INFODIR@%${INFODIR}%;"\
+ < ${f}.in > $f
+done
# =======================================================================
# vim:et:sw=2:ht=2:sts=2:fdm=marker:cms=#%s