3 NAME="indexdata-lui-solr-zookeeper"
7 PID_FILE=/var/run/${NAME}.pid
8 LOG_FILE=/var/log/${NAME}.log
10 OPTIONS=${OPTIONS:-options}
12 if [ -f "$OPTIONS" ]; then
15 echo "No options file ($OPTIONS). Using defaults."
18 if [ "$ZKHOSTS" == "" ] ; then
19 ZKHOSTS=${HOST}:${ZKPORT}
22 if [ "$BOOTSTRAP_CONF" != "" ] ; then
23 BOOTSTRAP_OPT="-Dbootstrap_confdir=$BOOTSTRAP_CONF"
25 if [ "$PORT" == "" ] ; then
29 if [ "$ZKHOSTS" == "" ] ; then
32 if [ "$SHARDS" == "" ] ; then
35 if [ "$ZOOKEEPER" == "yes" ] ; then
36 ZKRUN="-DzkRun -DnumShards=${SHARDS}"
38 OPTIONS=" -Djetty.port=$PORT ${BOOTSTRAP_OPT} -Dcollection.configName=$NAME ${ZKRUN} -DzkHost=${ZKHOSTS} "
39 if [ "$1" == "start" ]; then
40 if [ -f "${PID_FILE}" ] ; then
41 echo "pid file ${PID_FILE} exists. Already running?"
44 java $OPTIONS -jar start.jar > $LOG_FILE &
46 elif [ "$1" == "stop" ]; then
47 if [ -f "${PID_FILE}" ] ; then
48 kill `cat ${PID_FILE}`
51 echo "No pid file ($PID_FILE) found"
54 echo "$0 [start|stop|status]"