diff options
author | Andre Barboza <bmg.andre@gmail.com> | 2016-01-12 06:53:41 +0700 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2016-01-12 21:58:11 -0600 |
commit | aa59088973d5d87c7ed9875b91bb6a202735e1bd (patch) | |
tree | f1e890587772b3871107620de37c4b53a989ce02 /system/zookeeper/rc.zookeeper | |
parent | 5bfc33d67c95c024cddbc2da901a13e5ffaebd5c (diff) | |
download | slackbuilds-aa59088973d5d87c7ed9875b91bb6a202735e1bd.tar.gz |
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.zookeeper | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/system/zookeeper/rc.zookeeper b/system/zookeeper/rc.zookeeper new file mode 100644 index 0000000000..4753036060 --- /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 |