Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.2 KiB

  1. 1. Prerequisites
  2. ----------------
  3. You will need an entropy (randomness) source. If your OS has arc4random or
  4. getentropy then that is ideal. Otherwise, you can use the builtin arc4random
  5. implementation or the one built into LibreSSL.
  6. 2. Building / Installation
  7. --------------------------
  8. If you have checked this source using Git, follow these initial steps to
  9. prepare the source tree for building:
  10. 1. ensure you have the following packages installed:
  11. automake, autoconf, git, libtool
  12. 2. run './autogen.sh' to prepare the source tree for building
  13. or run './dist.sh' to prepare a tarball.
  14. To install OpenNTPD with default options:
  15. ./configure
  16. make
  17. make install
  18. This will install the OpenNTPD binary in /usr/local/sbin, configuration
  19. files in /usr/local/etc. To specify a different installation prefix,
  20. use the --prefix option to configure:
  21. ./configure --prefix=/opt
  22. make
  23. make install
  24. Will install OpenNTPD in /opt/{etc,sbin}. You can also override
  25. specific paths, for example:
  26. ./configure --prefix=/opt --sysconfdir=/etc/ntp
  27. make
  28. make install
  29. This will install the binaries in /opt/sbin, but will place the
  30. configuration files in /etc/ntp.
  31. OpenNTPD always uses Privilege Separation (ie the majority of the
  32. processing is done as a chroot'ed, unprivileged user).
  33. This requires that a user, group and directory to be created for it.
  34. The user should not be permitted to log in, and its home directory
  35. should be owned by root and be mode 755.
  36. If you do "make install", the Makefile will create the directory with
  37. the correct permissions and will prompt you for the rest if required.
  38. If, however, you need to perform all of these tasks yourself (eg if you
  39. are moving the built binaries to another system) then you will need to
  40. do something like the following (although the exact commands required
  41. for creating the user and group are system dependant):
  42. # groupadd _ntp
  43. # useradd -g _ntp -s /sbin/nologin -d /var/empty/ntp -c 'OpenNTP daemon' _ntp
  44. # mkdir -p /var/empty/ntp
  45. # chown 0 /var/empty/ntp
  46. # chgrp 0 /var/empty/ntp
  47. # chmod 0755 /var/empty/ntp
  48. There are a few options to the configure script in addition to the ones
  49. provided by autoconf itself:
  50. --with-privsep-user=[user]
  51. Specify unprivileged user used for privilege separation. The default
  52. is "_ntp".
  53. --with-privsep-path=path
  54. Normally ntpd will always use the home directory of the privsep user
  55. to chroot to, however use of this option will cause ntpd to always
  56. use the specified directory.
  57. If you need to pass special options to the compiler or linker, you
  58. can specify these as environment variables before running ./configure.
  59. For example:
  60. CFLAGS="-O -m486" LDFLAGS="-s" LIBS="-lrubbish" LD="/usr/foo/ld" ./configure
  61. 3. Configuration
  62. ----------------
  63. The runtime configuration files are installed by in ${prefix}/etc or
  64. whatever you specified as your --sysconfdir (/usr/local/etc by default).
  65. If no configuration file exists, the default one is used. The default
  66. configuration file uses a selection of publicly accessible "pool" servers
  67. (see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers).
  68. 4. Problems?
  69. ------------
  70. If you experience problems compiling, installing or running OpenNTPD,
  71. please report the problem to the address in the README file.