mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
aa59088973
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
42 lines
632 B
Bash
42 lines
632 B
Bash
#!/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
|