From d8e446253f6b4648636bf0c4aedc26d872ecaba9 Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 10 Mar 2010 16:46:46 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48793 Make catalina.sh more robust to different return values on different platforms Patch provided by Thomas GL git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@921444 13f79535-47bb-0310-9956-ffa450edef68 --- bin/catalina.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/catalina.sh b/bin/catalina.sh index a2eb4d8bf..6f80cdb3f 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -354,7 +354,7 @@ elif [ "$1" = "stop" ] ; then SLEEP=5 if [ ! -z "$1" ]; then echo $1 | grep "[^0-9]" > /dev/null 2>&1 - if [ $? -eq 1 ]; then + if [ $? -gt 0 ]; then SLEEP=$1 shift fi @@ -369,7 +369,7 @@ elif [ "$1" = "stop" ] ; then if [ ! -z "$CATALINA_PID" ]; then if [ -f "$CATALINA_PID" ]; then kill -0 `cat $CATALINA_PID` >/dev/null 2>&1 - if [ $? -eq 1 ]; then + if [ $? -gt 0 ]; then echo "PID file ($CATALINA_PID) found but no matching process was found. Stop aborted." exit 1 fi @@ -390,7 +390,7 @@ elif [ "$1" = "stop" ] ; then if [ -f "$CATALINA_PID" ]; then while [ $SLEEP -ge 0 ]; do kill -0 `cat $CATALINA_PID` >/dev/null 2>&1 - if [ $? -eq 1 ]; then + if [ $? -gt 0 ]; then rm $CATALINA_PID break fi -- 2.11.0