And while your at it can you look at the double '=' in: > + -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
See: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20859.
Greetings,
Ronald.
Noel J. Bergman wrote:
The attached patches are for catalina.sh under both the jakarta-tomcat-4 and jakarta-catalina modules. They re-synch changes made to one and not the other, and add a default for CATALINA_PID.
Tomcat 4 (http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/bin/catal ina.sh):
- adds Costin's -force patch from Tomcat 5 CVS - removed "exec" from stop so that force runs after an attempt to shutdown - adds CATALINA_PID default
Tomcat 5 (http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/ catalina.sh):
- adds Robert Upshall's patch for OS/400 - removed "exec" from stop so that force runs after an attempt to shutdown - adds CATALINA_PID default - changed $@ <command> to <command> $@ to match Tomcat 5 Bootstrap.main() [String command = args[0];]
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share /org/apache/catalina/startup/Bootstrap.java
Bug(lets):
- Tomcat 4 likes to ignore the command and display a usage message for unknown options. Causes problem with -force.
- If shutdown port == zero, shutdown request should not try to connect. Problem with both versions.
I'm not subscribed to tomcat-dev@, so please cc: me on any replies.
--- Noel
------------------------------------------------------------------------
--- catalina-4.sh 2003-06-24 17:30:56.000000000 -0400
+++ catalina-4-new.sh 2003-06-24 23:26:48.000000000 -0400
@@ -112,12 +112,18 @@
CATALINA_TMPDIR="$CATALINA_BASE"/temp
fi
+if [ -z "$CATALINA_PID" ] ; then
+ # Define the pid file for Catalina
+ CATALINA_PID="$CATALINA_BASE"/work/catalina.pid
+fi
+
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
CATALINA_BASE=`cygpath --path --windows "$CATALINA_BASE"`
CATALINA_TMPDIR=`cygpath --path --windows "$CATALINA_TMPDIR"`
+ CATALINA_PID=`cygpath --path --windows "$CATALINA_PID"`
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
JSSE_HOME=`cygpath --path --windows "$JSSE_HOME"`
fi
@@ -244,13 +250,23 @@
elif [ "$1" = "stop" ] ; then
shift
- exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
+ "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
org.apache.catalina.startup.Bootstrap "$@" stop
+ if [ "$1" = "-force" ] ; then
+ echo "Forcing Shutdown"
+ shift
+ if [ -f "$CATALINA_PID" ]; then
+ echo "Killing: `cat $CATALINA_PID`"
+ kill -9 `cat $CATALINA_PID` > /dev/null
+ rm -f "$CATALINA_PID"
+ fi
+ fi
+
else
echo "Usage: catalina.sh ( commands ... )"
@@ -269,6 +285,7 @@
echo " start Start Catalina in a separate window"
echo " start -security Start in a separate window with security manager"
echo " stop Stop Catalina"
+ echo " stop -force Stop Catalina -- kill process if necessary"
exit 1
fi
------------------------------------------------------------------------
--- catalina-5.sh 2003-06-12 03:58:24.000000000 -0400
+++ catalina-5-new.sh 2003-06-24 23:29:30.000000000 -0400
@@ -40,8 +40,10 @@
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
+os400=false
case "`uname`" in
CYGWIN*) cygwin=true;;
+OS400*) os400=true;;
esac
# resolve links - $0 may be a softlink
@@ -68,10 +70,23 @@
if $cygwin; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
+ [ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"`
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
[ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --path --unix "$JSSE_HOME"`
fi
+# For OS400
+if $os400; then
+ # Set job priority to standard for interactive (interactive - 6) by using
+ # the interactive priority - 6, the helper threads that respond to requests
+ # will be running at the same priority as interactive jobs.
+ COMMAND='chgjob job('$JOBNAME') runpty(6)'
+ system $COMMAND
+
+ # Enable multi threading
+ export QIBM_MULTI_THREADED=Y
+fi
+
# Get standard Java environment variables
if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
BASEDIR="$CATALINA_HOME"
@@ -97,12 +112,18 @@
CATALINA_TMPDIR="$CATALINA_BASE"/temp
fi
+if [ -z "$CATALINA_PID" ] ; then
+ # Define the pid file for Catalina
+ CATALINA_PID="$CATALINA_BASE"/work/catalina.pid
+fi
+
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
CATALINA_BASE=`cygpath --path --windows "$CATALINA_BASE"`
CATALINA_TMPDIR=`cygpath --path --windows "$CATALINA_TMPDIR"`
+ CATALINA_PID=`cygpath --path --windows "$CATALINA_PID"`
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
JSSE_HOME=`cygpath --path --windows "$JSSE_HOME"`
fi
@@ -130,27 +151,32 @@
if [ "$1" = "debug" ] ; then
- shift
- if [ "$1" = "-security" ] ; then
- echo "Using Security Manager"
- shift
- exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
- -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
- -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-4.0/catalina/src/share \
- -Djava.security.manager \
- -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" start
+ if $os400; then
+ echo "Debug command not available on OS400"
+ exit 1
else
- exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
- -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
- -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-4.0/catalina/src/share \
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" start
+ shift
+ if [ "$1" = "-security" ] ; then
+ echo "Using Security Manager"
+ shift
+ exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
+ -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
+ -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-4.0/catalina/src/share \
+ -Djava.security.manager \
+ -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
+ -Dcatalina.base="$CATALINA_BASE" \
+ -Dcatalina.home="$CATALINA_HOME" \
+ -Djava.io.tmpdir="$CATALINA_TMPDIR" \
+ org.apache.catalina.startup.Bootstrap start "$@"
+ else
+ exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
+ -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
+ -sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-4.0/catalina/src/share \
+ -Dcatalina.base="$CATALINA_BASE" \
+ -Dcatalina.home="$CATALINA_HOME" \
+ -Djava.io.tmpdir="$CATALINA_TMPDIR" \
+ org.apache.catalina.startup.Bootstrap start "$@"
+ fi
fi
elif [ "$1" = "embedded" ] ; then
@@ -177,14 +203,14 @@
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" start
+ org.apache.catalina.startup.Bootstrap start "$@"
else
exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" start
+ org.apache.catalina.startup.Bootstrap start "$@"
fi
elif [ "$1" = "start" ] ; then
@@ -201,7 +227,7 @@
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" start \
+ org.apache.catalina.startup.Bootstrap start "$@" \
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
if [ ! -z "$CATALINA_PID" ]; then
@@ -213,7 +239,7 @@
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" start \
+ org.apache.catalina.startup.Bootstrap start "$@" \
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
if [ ! -z "$CATALINA_PID" ]; then
@@ -224,28 +250,34 @@
elif [ "$1" = "stop" ] ; then
shift
- exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
+ "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
- org.apache.catalina.startup.Bootstrap "$@" stop
+ org.apache.catalina.startup.Bootstrap stop "$@"
if [ "$1" = "-force" ] ; then
+ echo "Forcing Shutdown"
shift
- if [ ! -z "$CATALINA_PID" ]; then
+ if [ -f "$CATALINA_PID" ]; then
echo "Killing: `cat $CATALINA_PID`"
- kill -9 `cat $CATALINA_PID`
+ kill -9 `cat $CATALINA_PID` > /dev/null
+ rm -f "$CATALINA_PID"
fi
fi
-
else
echo "Usage: catalina.sh ( commands ... )"
echo "commands:"
- echo " debug Start Catalina in a debugger"
- echo " debug -security Debug Catalina with a security manager"
+ if $os400; then
+ echo " debug Start Catalina in a debugger (not available on OS400)"
+ echo " debug -security Debug Catalina with a security manager (not available on OS400)"
+ else
+ echo " debug Start Catalina in a debugger"
+ echo " debug -security Debug Catalina with a security manager"
+ fi
echo " embedded Start Catalina in embedded mode"
echo " jpda start Start Catalina under JPDA debugger"
echo " run Start Catalina in the current window"
@@ -253,6 +285,7 @@
echo " start Start Catalina in a separate window"
echo " start -security Start in a separate window with security manager"
echo " stop Stop Catalina"
+ echo " stop -force Stop Catalina -- kill process if necessary"
exit 1
fi
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]