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.

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