From: markt Date: Thu, 2 Jun 2011 20:09:27 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51309 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=68bdbb0867abf9f649b2445d7465ee197798ba21;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51309 Correct logic in catalina.sh stop when using a PID file to ensure the correct message is shown. Patch provided by Caio Cezar. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1130774 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/bin/catalina.sh b/bin/catalina.sh index e07d0ec73..0fdd96897 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -412,19 +412,19 @@ elif [ "$1" = "stop" ] ; then fi if [ ! -z "$CATALINA_PID" ]; then - if [ -s "$CATALINA_PID" ]; then - if [ -f "$CATALINA_PID" ]; then + if [ -f "$CATALINA_PID" ]; then + if [ -s "$CATALINA_PID" ]; then kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1 if [ $? -gt 0 ]; then echo "PID file found but no matching process was found. Stop aborted." exit 1 fi else - echo "\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted." - exit 1 + echo "PID file is empty and has been ignored." fi else - echo "PID file is empty and has been ignored." + echo "\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted." + exit 1 fi fi diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 0ecac3e79..1c2f30b12 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -153,6 +153,11 @@ 46451: Configure svn:bugtraq properties for Tomcat trunk. Based on a patch provided by Marc Guillemot. (markt) + + 51309: Correct logic in catalina.sh stop when using a PID + file to ensure the correct message is shown. Patch provided by Caio + Cezar. (markt) +