Blame INSTALL

Packit 96c956
Installation
Packit 96c956
Packit 96c956
The software is distributed as source code which has to be compiled. The source
Packit 96c956
code is supplied in the form of a gzipped tar file, which unpacks to a
Packit 96c956
subdirectory identifying the name and version of the program.
Packit 96c956
Packit 96c956
The following programs and libraries with their development files are needed to
Packit 96c956
build chrony:
Packit 96c956
Packit 96c956
  o C compiler (gcc or clang recommended)
Packit 96c956
Packit 96c956
  o GNU Make
Packit 96c956
Packit 96c956
  o Nettle, NSS, or LibTomCrypt (optional)
Packit 96c956
Packit 96c956
  o Editline (optional)
Packit 96c956
Packit 96c956
  o libcap (Linux only, optional)
Packit 96c956
Packit 96c956
  o libseccomp (Linux only, optional)
Packit 96c956
Packit 96c956
  o timepps.h header (optional)
Packit 96c956
Packit 96c956
  o Asciidoctor (for HTML documentation)
Packit 96c956
Packit 96c956
  o Bash (for testing)
Packit 96c956
Packit 96c956
After unpacking the source code, change directory into it, and type
Packit 96c956
Packit 96c956
./configure
Packit 96c956
Packit 96c956
This is a shell script that automatically determines the system type. There is
Packit 96c956
an optional parameter --prefix, which indicates the directory tree where the
Packit 96c956
software should be installed. For example,
Packit 96c956
Packit 96c956
./configure --prefix=/opt/free
Packit 96c956
Packit 96c956
will install the chronyd daemon into /opt/free/sbin and the chronyc control
Packit 96c956
program into /opt/free/bin. The default value for the prefix is /usr/local.
Packit 96c956
Packit 96c956
The configure script assumes you want to use gcc as your compiler. If you want
Packit 96c956
to use a different compiler, you can configure this way:
Packit 96c956
Packit 96c956
CC=cc ./configure --prefix=/opt/free
Packit 96c956
Packit 96c956
for Bourne-family shells, or
Packit 96c956
Packit 96c956
setenv CC cc
Packit 96c956
setenv CFLAGS -O
Packit 96c956
./configure --prefix=/opt/free
Packit 96c956
Packit 96c956
for C-family shells.
Packit 96c956
Packit 96c956
If the software cannot (yet) be built on your system, an error message will be
Packit 96c956
shown. Otherwise, Makefile will be generated.
Packit 96c956
Packit 96c956
On Linux, if development files for the libcap library are available, chronyd
Packit 96c956
will be built with support for dropping root privileges. On other systems no
Packit 96c956
extra library is needed. The default user which chronyd should run as can be
Packit 96c956
specified with the --with-user option of the configure script.
Packit 96c956
Packit 96c956
If development files for the POSIX threads library are available, chronyd will
Packit 96c956
be built with support for asynchronous resolving of hostnames specified in the
Packit 96c956
server, peer, and pool directives. This allows chronyd operating as a server to
Packit 96c956
respond to client requests when resolving a hostname. If you don't want to
Packit 96c956
enable the support, specify the --disable-asyncdns flag to configure.
Packit 96c956
Packit 96c956
If development files for the Nettle, NSS, or libtomcrypt library are available,
Packit 96c956
chronyd will be built with support for other cryptographic hash functions than
Packit 96c956
MD5, which can be used for NTP authentication with a symmetric key. If you
Packit 96c956
don't want to enable the support, specify the --disable-sechash flag to
Packit 96c956
configure.
Packit 96c956
Packit 96c956
If development files for the editline or readline library are available,
Packit 96c956
chronyc will be built with line editing support. If you don't want this,
Packit 96c956
specify the --disable-readline flag to configure.
Packit 96c956
Packit 96c956
If a timepps.h header is available (e.g. from the LinuxPPS project), chronyd
Packit 96c956
will be built with PPS API reference clock driver. If the header is installed
Packit 96c956
in a location that isn't normally searched by the compiler, you can add it to
Packit 96c956
the searched locations by setting the CPPFLAGS variable to -I/path/to/timepps.
Packit 96c956
Packit 96c956
The --help option can be specified to configure to print all options supported
Packit 96c956
by the script.
Packit 96c956
Packit 96c956
Now type
Packit 96c956
Packit 96c956
make
Packit 96c956
Packit 96c956
to build the programs.
Packit 96c956
Packit 96c956
If you want to build the manual in HTML, type
Packit 96c956
Packit 96c956
make docs
Packit 96c956
Packit 96c956
Once the programs have been successfully compiled, they need to be installed in
Packit 96c956
their target locations. This step normally needs to be performed by the
Packit 96c956
superuser, and requires the following command to be entered.
Packit 96c956
Packit 96c956
make install
Packit 96c956
Packit 96c956
This will install the binaries and man pages.
Packit 96c956
Packit 96c956
To install the HTML version of the manual, enter the command
Packit 96c956
Packit 96c956
make install-docs
Packit 96c956
Packit 96c956
Now that the software is successfully installed, the next step is to set up a
Packit 96c956
configuration file. The default location of the file is /etc/chrony.conf.
Packit 96c956
Several examples of configuration with comments are included in the examples
Packit 96c956
directory. Suppose you want to use public NTP servers from the pool.ntp.org
Packit 96c956
project as your time reference. A minimal useful configuration file could be
Packit 96c956
Packit 96c956
pool pool.ntp.org iburst
Packit 96c956
makestep 1.0 3
Packit 96c956
rtcsync
Packit 96c956
Packit 96c956
Then, chronyd can be run. For security reasons, it's recommended to create an
Packit 96c956
unprivileged user for chronyd and specify it with the -u command-line option or
Packit 96c956
the user directive in the configuration file, or set the default user with the
Packit 96c956
--with-user configure option before building.
Packit 96c956
Packit 96c956
Support for system call filtering
Packit 96c956
Packit 96c956
chronyd can be built with support for the Linux secure computing (seccomp)
Packit 96c956
facility. This requires development files for the libseccomp library and the
Packit 96c956
--enable-scfilter option specified to configure. The -F option of chronyd will
Packit 96c956
enable a system call filter, which should significantly reduce the kernel
Packit 96c956
attack surface and possibly prevent kernel exploits from chronyd if it is
Packit 96c956
compromised.
Packit 96c956
Packit 96c956
Support for line editing libraries
Packit 96c956
Packit 96c956
chronyc can be built with support for line editing, this allows you to use the
Packit 96c956
cursor keys to replay and edit old commands. Two libraries are supported which
Packit 96c956
provide such functionality, editline and GNU readline.
Packit 96c956
Packit 96c956
Please note that readline since version 6.0 is licensed under GPLv3+ which is
Packit 96c956
incompatible with chrony's license GPLv2. You should use editline instead if
Packit 96c956
you don't want to use older readline versions.
Packit 96c956
Packit 96c956
The configure script will automatically enable the line editing support if one
Packit 96c956
of the supported libraries is available. If they are both available, the
Packit 96c956
editline library will be used.
Packit 96c956
Packit 96c956
If you don't want to use it (in which case chronyc will use a minimal command
Packit 96c956
line interface), invoke configure like this:
Packit 96c956
Packit 96c956
./configure --disable-readline other-options...
Packit 96c956
Packit 96c956
If you have editline, readline or ncurses installed in locations that aren't
Packit 96c956
normally searched by the compiler and linker, you need to use extra options:
Packit 96c956
Packit 96c956
--with-readline-includes=directory_name
Packit 96c956
Packit 96c956
    This defines the name of the directory above the one where readline.h is.
Packit 96c956
    readline.h is assumed to be in editline or readline subdirectory of the
Packit 96c956
    named directory.
Packit 96c956
Packit 96c956
--with-readline-library=directory_name
Packit 96c956
Packit 96c956
    This defines the directory containing the libedit.a or libedit.so file, or
Packit 96c956
    libreadline.a or libreadline.so file.
Packit 96c956
Packit 96c956
--with-ncurses-library=directory_name
Packit 96c956
Packit 96c956
    This defines the directory containing the libncurses.a or libncurses.so
Packit 96c956
    file.
Packit 96c956
Packit 96c956
Extra options for package builders
Packit 96c956
Packit 96c956
The configure and make procedures have some extra options that may be useful if
Packit 96c956
you are building a distribution package for chrony.
Packit 96c956
Packit 96c956
The --mandir=DIR option to configure specifies an installation directory for
Packit 96c956
the man pages. This overrides the man subdirectory of the argument to the
Packit 96c956
--prefix option.
Packit 96c956
Packit 96c956
./configure --prefix=/usr --mandir=/usr/share/man
Packit 96c956
Packit 96c956
to set both options together.
Packit 96c956
Packit 96c956
The final option is the DESTDIR option to the make command. For example, you
Packit 96c956
could use the commands
Packit 96c956
Packit 96c956
./configure --prefix=/usr --mandir=/usr/share/man
Packit 96c956
make all docs
Packit 96c956
make install DESTDIR=./tmp
Packit 96c956
cd tmp
Packit 96c956
tar cvf - . | gzip -9 > chrony.tar.gz
Packit 96c956
Packit 96c956
to build a package. When untarred within the root directory, this will install
Packit 96c956
the files to the intended final locations.
Packit 96c956
Packit 96c956
Last updated 2019-05-10 12:22:57 CEST