Skip to content

Commit

Permalink
Merge pull request #22 from morind/master
Browse files Browse the repository at this point in the history
fix issue: pid file is still empty
  • Loading branch information
cityzendata authored Dec 22, 2017
2 parents cadd956 + 10d31b6 commit 309060d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sensision/src/main/shell/sensision.init
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ start() {
}

stop() {
if [ -e ${PID_FILE} ]; then
kill `su "${SENSISION_USER}" -c "${JAVA_HOME}/bin/jps -l|grep ${SENSISION_CLASS}|cut -f 1 -d' '"`
if [ -e ${PID_FILE} ] && [ "`su \"${SENSISION_USER}\" -c \"${JAVA_HOME}/bin/jps -lm|grep -wE $(cat ${PID_FILE})|cut -f 1 -d' '\"`" != "" ]; then
kill `su "${SENSISION_USER}" -c "${JAVA_HOME}/bin/jps -lm|grep -wE $(cat ${PID_FILE})|cut -f 1 -d' '"`
rm -f ${PID_FILE}
else
echo "No instance of Sensision is currently running"
Expand All @@ -344,7 +344,7 @@ stop() {

status() {
if [ -e ${PID_FILE} ]; then
su "${SENSISION_USER}" -c "${JAVA_HOME}/bin/jps -l|grep ${SENSISION_CLASS}"
su "${SENSISION_USER}" -c "${JAVA_HOME}/bin/jps -lm|grep -wE $(cat ${PID_FILE})"
fi
}

Expand Down

0 comments on commit 309060d

Please sign in to comment.