Author: markt
Date: Mon Jan 13 15:28:31 2014
New Revision: 1557751
URL: http://svn.apache.org/r1557751
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55743
Enable the stop script to work when the shutdown port is disabled and a PID
file is defined.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/bin/catalina.sh
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1557747
Modified: tomcat/tc7.0.x/trunk/bin/catalina.sh
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/bin/catalina.sh?rev=1557751&r1=1557750&r2=1557751&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/bin/catalina.sh (original)
+++ tomcat/tc7.0.x/trunk/bin/catalina.sh Mon Jan 13 15:28:31 2014
@@ -398,6 +398,8 @@ elif [ "$1" = "start" ] ; then
echo $! > "$CATALINA_PID"
fi
+ echo "Tomcat started."
+
elif [ "$1" = "stop" ] ; then
shift
@@ -441,6 +443,14 @@ elif [ "$1" = "stop" ] ; then
-Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
org.apache.catalina.startup.Bootstrap "$@" stop
+ # stop failed. Shutdown port disabled? Try a normal kill.
+ if [ $? != 0 ]; then
+ if [ ! -z "$CATALINA_PID" ]; then
+ echo "The stop command failed. Attempting to signal the process to stop
through OS signal."
+ kill -15 `cat "$CATALINA_PID"` >/dev/null 2>&1
+ fi
+ fi
+
if [ ! -z "$CATALINA_PID" ]; then
if [ -f "$CATALINA_PID" ]; then
while [ $SLEEP -ge 0 ]; do
@@ -453,9 +463,10 @@ elif [ "$1" = "stop" ] ; then
# If Tomcat has stopped don't try and force a stop with an empty
PID file
FORCE=0
else
- echo "Tomcat stopped but the PID file could not be removed or
cleared."
+ echo "The PID file could not be removed or cleared."
fi
fi
+ echo "Tomcat stopped."
break
fi
if [ $SLEEP -gt 0 ]; then
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1557751&r1=1557750&r2=1557751&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon Jan 13 15:28:31 2014
@@ -126,6 +126,15 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Other">
+ <changelog>
+ <fix>
+ <bug>55743</bug>: Enable the stop script to work when the shutdown port
+ is disabled and a PID file is defined. This is only available on
+ platforms that use <code>catalina.sh</code>. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 7.0.50 (violetagg)" rtext="2014-01-08">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]