projects
/
lui-solr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
68d8604
)
fix stop and pid file
author
Dennis Schafroth
<dennis@indexdata.com>
Tue, 4 Mar 2014 16:37:05 +0000
(17:37 +0100)
committer
Dennis Schafroth
<dennis@indexdata.com>
Tue, 4 Mar 2014 16:37:05 +0000
(17:37 +0100)
scripts/zookeeper.sh
patch
|
blob
|
history
diff --git
a/scripts/zookeeper.sh
b/scripts/zookeeper.sh
index
329f175
..
50491e4
100755
(executable)
--- a/
scripts/zookeeper.sh
+++ b/
scripts/zookeeper.sh
@@
-1,4
+1,4
@@
-#/bin/bash
+#!/bin/bash
NAME="indexdata-lui-solr-zookeeper"
HOST=localhost
NAME="indexdata-lui-solr-zookeeper"
HOST=localhost
@@
-43,14
+43,19
@@
OPTIONS=" $SOLR_HOME_OPT -Djetty.port=$PORT ${BOOTSTRAP_OPT} -Dcollection.config
if [ "$1" == "start" ]; then
if [ -f "${PID_FILE}" ] ; then
echo "pid file ${PID_FILE} exists. Already running?"
if [ "$1" == "start" ]; then
if [ -f "${PID_FILE}" ] ; then
echo "pid file ${PID_FILE} exists. Already running?"
- exit 1
+ else
+ java $OPTIONS -jar start.jar > $LOG_FILE &
+ echo $! > ${PID_FILE}
fi
fi
- java $OPTIONS -jar start.jar > $LOG_FILE &
- echo $! > ${PID_FILE}
elif [ "$1" == "stop" ]; then
if [ -f "${PID_FILE}" ] ; then
elif [ "$1" == "stop" ]; then
if [ -f "${PID_FILE}" ] ; then
- kill `cat ${PID_FILE}`
- rm ${PID_FILE}
+ PID="`/bin/cat ${PID_FILE}`"
+ if [ "$PID" != "" ] ; then
+ kill $PID
+ /bin/rm ${PID_FILE}
+ else
+ echo "Unable to extract PID from ${PID_FILE}"
+ fi
else
echo "No pid file ($PID_FILE) found"
fi
else
echo "No pid file ($PID_FILE) found"
fi