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 if [ "${SOLR_HOME}" != "" ] ; then
39 SOLR_HOME_OPT="-Dsolr.solr.home=${SOLR_HOME}"
42 OPTIONS=" $SOLR_HOME_OPT -Djetty.port=$PORT ${BOOTSTRAP_OPT} -Dcollection.configName=$NAME ${ZKRUN} -DzkHost=${ZKHOSTS} "
43 if [ "$1" == "start" ]; then
44 if [ -f "${PID_FILE}" ] ; then
45 echo "pid file ${PID_FILE} exists. Already running?"
48 java $OPTIONS -jar start.jar > $LOG_FILE &
50 elif [ "$1" == "stop" ]; then
51 if [ -f "${PID_FILE}" ] ; then
52 kill `cat ${PID_FILE}`
55 echo "No pid file ($PID_FILE) found"
58 echo "$0 [start|stop|status]"