Author: markt Date: Thu Jun 2 20:09:27 2011 New Revision: 1130774 URL: http://svn.apache.org/viewvc?rev=1130774&view=rev Log: 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.
Modified: tomcat/trunk/bin/catalina.sh tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/bin/catalina.sh URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1130774&r1=1130773&r2=1130774&view=diff ============================================================================== --- tomcat/trunk/bin/catalina.sh (original) +++ tomcat/trunk/bin/catalina.sh Thu Jun 2 20:09:27 2011 @@ -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 Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1130774&r1=1130773&r2=1130774&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 2 20:09:27 2011 @@ -153,6 +153,11 @@ <bug>46451</bug>: Configure svn:bugtraq properties for Tomcat trunk. Based on a patch provided by Marc Guillemot. (markt) </fix> + <fix> + <bug>51309</bug>: Correct logic in catalina.sh stop when using a PID + file to ensure the correct message is shown. Patch provided by Caio + Cezar. (markt) + </fix> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org