aboutsummaryrefslogtreecommitdiff
path: root/system/zookeeper/rc.zookeeper
diff options
context:
space:
mode:
authorAndre Barboza <bmg.andre@gmail.com>2016-01-12 06:53:41 +0700
committerRobby Workman <rworkman@slackbuilds.org>2016-01-12 21:58:11 -0600
commitaa59088973d5d87c7ed9875b91bb6a202735e1bd (patch)
treef1e890587772b3871107620de37c4b53a989ce02 /system/zookeeper/rc.zookeeper
parent5bfc33d67c95c024cddbc2da901a13e5ffaebd5c (diff)
system/zookeeper: Added (distributed coordination server).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/zookeeper/rc.zookeeper')
-rw-r--r--system/zookeeper/rc.zookeeper42
1 files changed, 42 insertions, 0 deletions
diff --git a/system/zookeeper/rc.zookeeper b/system/zookeeper/rc.zookeeper
new file mode 100644
index 0000000000000..4753036060473
--- /dev/null
+++ b/system/zookeeper/rc.zookeeper
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Start/stop/restart Apache Zookeeper daemon
+
+USER=zookeeper
+
+zookeeper_start(){
+ sudo -u ${USER} sh -c "/usr/bin/zkServer start"
+}
+
+zookeeper_stop() {
+ sudo -u ${USER} sh -c "/usr/bin/zkServer stop"
+}
+
+zookeeper_restart() {
+ sudo -u ${USER} sh -c "/usr/bin/zkServer restart"
+}
+
+zookeeper_status() {
+ sudo -u ${USER} sh -c "/usr/bin/zkServer status"
+}
+
+print_usage() {
+ echo "usage $0 start|stop|restart|status"
+}
+
+case "$1" in
+ 'start')
+ zookeeper_start
+ ;;
+ 'stop')
+ zookeeper_stop
+ ;;
+ 'restart')
+ zookeeper_restart
+ ;;
+ 'status')
+ zookeeper_status
+ ;;
+ *)
+ print_usage
+ ;;
+esac