From: Dennis Schafroth Date: Fri, 29 Nov 2013 11:34:51 +0000 (+0100) Subject: default to /var/[log|run] X-Git-Tag: v0.6.0~9 X-Git-Url: http://git.indexdata.com/?p=lui-solr.git;a=commitdiff_plain;h=25f05a50d56914f69f53801fa2680fbd9c9d8f1b;hp=df39a9c5d2f4247b0682f2c6cf0d64b22edfaadd default to /var/[log|run] --- diff --git a/scripts/zookeeper.sh b/scripts/zookeeper.sh index 8ff8bb4..8e48202 100755 --- a/scripts/zookeeper.sh +++ b/scripts/zookeeper.sh @@ -1,28 +1,27 @@ #/bin/bash -DIR=`dirname $0` -PROG=`basename $0` - -cd $DIR -OPTIONS="-Djetty.port=7500 -DzkHost=opencontent-solr.index:9983" +OPTIONS="-Djetty.port=8983 -DzkHost=opencontent-solr.index:9983" +NAME="indexdata-solr-zookeeper" +PID_FILE=/var/run/${NAME}.pid +LOG_FILE=/var/log/${NAME}.log if [ -f "options" ]; then source options else echo "No options file. Using defaults: $OPTIONS" fi -if [ "$1" = "start" ]; then - if [ -f "${PROG}.pid" ] ; then - echo "Pid file ${DIR}/${PROG}.pid exists. Already running?" +if [ "$1" == "start" ]; then + if [ -f "${PID_FILE}" ] ; then + echo "pid file ${PID_FILE} exists. Already running?" exit 1 fi - java $OPTIONS -jar start.jar > solr.log & - echo $$ > ${PROG}.pid -elif [ "$1" = "stop" ]; then - if [ -x "${PROG}.pid" ] ; then - kill `echo ${PROG}.pid` - rm ${PROG}.pid + java $OPTIONS -jar start.jar > $LOG_FILE & + echo $! > ${PID_FILE} +elif [ "$1" == "stop" ]; then + if [ -x "${PID_FILE}" ] ; then + kill `echo ${PID_FILE}` + rm ${PID_FILE} fi else - echo "$0 [start|stop]" + echo "$0 [start|stop|status]" fi