diff options
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 |