aboutsummaryrefslogtreecommitdiff
path: root/package/openntpd
diff options
context:
space:
mode:
authorGravatar Gustavo Zacarias <gustavo@zacarias.com.ar>2014-06-11 08:33:15 -0300
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-07-08 14:16:51 +0200
commitfb6c286697c5f579759fd279ea421667755700ef (patch)
tree7415882d0ff8646ca6e176b62536c4513d20a2b0 /package/openntpd
parent483e3bef47b3f024e4181403b3665702101c03e1 (diff)
downloadbuildroot-fb6c286697c5f579759fd279ea421667755700ef.tar.gz
buildroot-fb6c286697c5f579759fd279ea421667755700ef.tar.bz2
openntpd: add SysV initscript and user
Add the _ntp user that the daemon requires to work in any way. Add a SysV-style initscript as well, but not with '-s' (set time immediately after startup) because it can make the boot process stall for a few seconds if there's no proper network connectivity/dns setup. Make ntp and openntpd mutually exclusive since they overstep each other. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/openntpd')
-rw-r--r--package/openntpd/Config.in4
-rwxr-xr-xpackage/openntpd/S49ntp25
-rw-r--r--package/openntpd/openntpd.mk9
3 files changed, 36 insertions, 2 deletions
diff --git a/package/openntpd/Config.in b/package/openntpd/Config.in
index 4dd9a297d5..a8ef807e62 100644
--- a/package/openntpd/Config.in
+++ b/package/openntpd/Config.in
@@ -1,7 +1,7 @@
config BR2_PACKAGE_OPENNTPD
bool "openntpd"
- # fork()
- depends on BR2_USE_MMU
+ depends on BR2_USE_MMU # fork ()
+ depends on !BR2_PACKAGE_NTP # conflicting binaries
help
OpenNTPD is an easy to use implementation of the Network Time
Protocol. It provides the ability to sync the local clock
diff --git a/package/openntpd/S49ntp b/package/openntpd/S49ntp
new file mode 100755
index 0000000000..99e0f68af2
--- /dev/null
+++ b/package/openntpd/S49ntp
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+[ -x /usr/sbin/ntpd ] || exit 0
+[ -f /etc/ntpd.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting openntpd: "
+ start-stop-daemon -S -x /usr/sbin/ntpd
+ [ $? == 0 ] && echo "OK" || echo "FAIL"
+ ;;
+ stop)
+ echo -n "Stopping openntpd: "
+ start-stop-daemon -K -x /usr/sbin/ntpd
+ [ $? == 0 ] && echo "OK" || echo "FAIL"
+ ;;
+ restart)
+ "$0" stop
+ sleep 1
+ "$0" start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ ;;
+esac
diff --git a/package/openntpd/openntpd.mk b/package/openntpd/openntpd.mk
index f0e4f19997..0fe61799fa 100644
--- a/package/openntpd/openntpd.mk
+++ b/package/openntpd/openntpd.mk
@@ -10,4 +10,13 @@ OPENNTPD_CONF_OPT = --with-builtin-arc4random --disable-strip
OPENNTPD_LICENSE = MIT-like, BSD-2c, BSD-3c
OPENNTPD_LICENSE_FILES = LICENCE
+define OPENNTPD_INSTALL_INIT_SYSV
+ $(INSTALL) -m 0755 -D package/openntpd/S49ntp \
+ $(TARGET_DIR)/etc/init.d/S49ntp
+endef
+
+define OPENNTPD_USERS
+_ntp -1 _ntp -1 * - - - Network Time Protocol daemon
+endef
+
$(eval $(autotools-package))