summaryrefslogtreecommitdiffstats
path: root/package/chrony
diff options
context:
space:
mode:
authorPeter Korsgaard <peter@korsgaard.com>2014-08-12 18:02:46 +0200
committerPeter Korsgaard <peter@korsgaard.com>2014-08-12 18:02:46 +0200
commitd016a6a30dd86f5d6a02663fa4729a75e48ae379 (patch)
tree5050d17218f693da847c0cae1accd4d653297e22 /package/chrony
parent2c881c4b1aa5c96dd14e314ec685356f89f45483 (diff)
downloadbuildroot-d016a6a30dd86f5d6a02663fa4729a75e48ae379.tar.gz
buildroot-d016a6a30dd86f5d6a02663fa4729a75e48ae379.zip
chrony: add sysv initscript
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/chrony')
-rwxr-xr-xpackage/chrony/S49chrony26
-rw-r--r--package/chrony/chrony.mk4
2 files changed, 30 insertions, 0 deletions
diff --git a/package/chrony/S49chrony b/package/chrony/S49chrony
new file mode 100755
index 0000000000..66a50d59c0
--- /dev/null
+++ b/package/chrony/S49chrony
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Start chrony
+
+[ -f /etc/chrony.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo "Starting chrony: "
+ chronyd && echo "OK" || echo "FAIL"
+ ;;
+ stop)
+ echo -n "Stopping chrony: "
+ killall chronyd && echo "OK" || echo "FAIL"
+ ;;
+ restart|reload)
+ "$0" stop
+ sleep 1
+ "$0" start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/package/chrony/chrony.mk b/package/chrony/chrony.mk
index 09a4a1e8ce..afe0fc87d4 100644
--- a/package/chrony/chrony.mk
+++ b/package/chrony/chrony.mk
@@ -39,4 +39,8 @@ define CHRONY_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install
endef
+define CHRONY_INSTALL_INIT_SYSV
+ $(INSTALL) -D -m 755 package/chrony/S49chrony $(TARGET_DIR)/etc/init.d/S49chrony
+endef
+
$(eval $(generic-package))
OpenPOWER on IntegriCloud