8e4820263081b76a33de0876bdfc45b94d84f3c5
[lui-solr.git] / scripts / zookeeper.sh
1 #/bin/bash
2
3 OPTIONS="-Djetty.port=8983 -DzkHost=opencontent-solr.index:9983"
4 NAME="indexdata-solr-zookeeper"
5 PID_FILE=/var/run/${NAME}.pid
6 LOG_FILE=/var/log/${NAME}.log
7 if [ -f "options" ]; then 
8     source options
9 else
10     echo "No options file. Using defaults: $OPTIONS"
11 fi
12
13 if [ "$1" == "start" ]; then 
14     if [ -f "${PID_FILE}" ] ; then 
15         echo "pid file ${PID_FILE} exists. Already running?"
16         exit 1
17     fi
18     java $OPTIONS  -jar start.jar > $LOG_FILE & 
19     echo $! > ${PID_FILE}
20 elif [ "$1" == "stop" ]; then 
21     if [ -x "${PID_FILE}" ] ; then 
22         kill `echo ${PID_FILE}`
23         rm ${PID_FILE}
24     fi
25 else
26         echo "$0 [start|stop|status]" 
27 fi