From 25f05a50d56914f69f53801fa2680fbd9c9d8f1b Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Fri, 29 Nov 2013 12:34:51 +0100 Subject: [PATCH] default to /var/[log|run] --- scripts/zookeeper.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) 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 -- 1.7.10.4