components/tomcat/patches/env.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Wed, 10 Jul 2013 01:44:35 -0700
changeset 1386 4e8ea821eb75
parent 1166 36691b5d318b
child 3959 0de894549bd0
child 4146 097063f324c0
permissions -rw-r--r--
16990382 allow multiple Tomcat instances to be run

--- apache-tomcat-6.0.37-src/bin/catalina.sh	Mon Apr 29 02:36:52 2013
+++ apache-tomcat-6.0.37-src/bin/catalina.sh	Thu Jun 13 05:37:46 2013
@@ -92,6 +92,7 @@
 CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
 Darwin*) darwin=true;;
+SunOS*) solaris=true;;
 esac
 
 # resolve links - $0 may be a softlink
@@ -120,7 +121,13 @@
 # but allow them to be specified in setenv.sh, in rare case when it is needed.
 CLASSPATH=
 
-if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
+# On Solaris we install Tomcat into two different locations
+# (CATALINA_HOME, CATALINA_BASE). CATALINA_HOME can be on read only
+# location and CATALINA_BASE doesn't contain bin directory. Therefore we
+# will look for setenv.sh file in CATALINA_BASE/conf directory first.
+if [ -r "$CATALINA_BASE/conf/setenv.sh" ]; then
+  . "$CATALINA_BASE/conf/setenv.sh"
+elif [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
   . "$CATALINA_BASE/bin/setenv.sh"
 elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
   . "$CATALINA_HOME/bin/setenv.sh"
@@ -147,6 +154,11 @@
   export QIBM_MULTI_THREADED=Y
 fi
 
+# For Solaris
+if $solaris; then
+  [ -z "$JAVA_HOME" ] && JAVA_HOME=/usr/jdk/instances/jdk1.7.0
+fi
+
 # Get standard Java environment variables
 if $os400; then
   # -r will Only work on the os400 if the files are:
--- apache-tomcat-6.0.37-src/bin/tool-wrapper.sh	Mon Apr 29 02:36:52 2013
+++ apache-tomcat-6.0.37-src/bin/tool-wrapper.sh	Thu Jun 13 05:55:06 2013
@@ -35,8 +35,10 @@
 
 # OS specific support.  $var _must_ be set to either true or false.
 cygwin=false
+solaris=false
 case "`uname`" in
 CYGWIN*) cygwin=true;;
+SunOS*) solaris=true;;
 esac
 
 # resolve links - $0 may be a softlink
@@ -60,8 +62,16 @@
 # but allow them to be specified in setenv.sh, in rare case when it is needed.
 CLASSPATH=
 
-if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
-  . "$CATALINA_HOME"/bin/setenv.sh
+# On Solaris we install Tomcat into two different locations
+# (CATALINA_HOME, CATALINA_BASE). CATALINA_HOME can be on read only
+# location and CATALINA_BASE doesn't contain bin directory. Therefore we
+# will look for setenv.sh file in CATALINA_BASE/conf directory first.
+if [ -r "$CATALINA_BASE/conf/setenv.sh" ]; then
+  . "$CATALINA_BASE/conf/setenv.sh"
+elif [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
+  . "$CATALINA_BASE/bin/setenv.sh"
+elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
+  . "$CATALINA_HOME/bin/setenv.sh"
 fi
 
 # For Cygwin, ensure paths are in UNIX format before anything is touched
@@ -71,6 +81,11 @@
   [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
 fi
 
+# For Solaris
+if $solaris; then
+  [ -z "$JAVA_HOME" ] && JAVA_HOME=/usr/jdk/instances/jdk1.7.0
+fi
+
 # Get standard Java environment variables
 if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
   BASEDIR="$CATALINA_HOME"