Author: markt Date: Wed Mar 10 16:46:46 2010 New Revision: 921444 URL: http://svn.apache.org/viewvc?rev=921444&view=rev Log: 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
Modified: tomcat/trunk/bin/catalina.sh Modified: tomcat/trunk/bin/catalina.sh URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=921444&r1=921443&r2=921444&view=diff ============================================================================== --- tomcat/trunk/bin/catalina.sh (original) +++ tomcat/trunk/bin/catalina.sh Wed Mar 10 16:46:46 2010 @@ -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 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org