Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 53 lines (39 sloc) 1.04 KB
#!/bin/bash
set -e
source /var/vcap/packages/openjdk-8/bosh/runtime.env
export ZOOCFGDIR=/var/vcap/jobs/zookeeper/config
export ZOO_LOG_DIR=/var/vcap/sys/log/zookeeper
export ZOO_LOG4J_PROP="INFO,CONSOLE,ROLLINGFILE"
export LOG_DIR=/var/vcap/sys/log/zookeeper
export RUN_DIR=/var/vcap/sys/run/zookeeper
export PIDFILE=/var/vcap/sys/run/zookeeper/pid
export TMPDIR=/var/vcap/data/zookeeper/tmp
case $1 in
start)
mkdir -p $LOG_DIR $RUN_DIR
chown -R vcap:vcap $LOG_DIR $RUN_DIR
echo $$ > $PIDFILE
exec chpst -u vcap:vcap \
/var/vcap/packages/zookeeper/bin/zkServer.sh start-foreground \
>>/var/vcap/sys/log/zookeeper/stdout.log \
2>>/var/vcap/sys/log/zookeeper/stderr.log
;;
stop)
if [ -f $PIDFILE ]; then
kill -9 `cat $PIDFILE` || true
rm -f $PIDFILE
fi
;;
status)
exec /var/vcap/packages/zookeeper/bin/zkServer.sh status
;;
cli)
shift
exec /var/vcap/packages/zookeeper/bin/zkCli.sh $@
;;
*)
echo "Usage: $0 {start|stop|status|cli}"
exit 1
;;
esac
exit 0