From 182614e8832e1db45f8e99806c7b5053b365cba7 Mon Sep 17 00:00:00 2001 From: markt Date: Sat, 1 Dec 2007 19:48:16 +0000 Subject: [PATCH] Fix bug 43594. Use setenv from CATALINA_BASE (if set) in preference to the one in CATALINA_HOME. Patch provided by Shaddy Baddah. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@600185 13f79535-47bb-0310-9956-ffa450edef68 --- RUNNING.txt | 2 ++ bin/catalina.bat | 5 +++++ bin/catalina.sh | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RUNNING.txt b/RUNNING.txt index b9488cdda..770de6b4d 100644 --- a/RUNNING.txt +++ b/RUNNING.txt @@ -106,6 +106,8 @@ When you use this "-Dcatalina.base=$CATALINA_BASE" argument, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME: +* bin - Only setenv.sh (*nix) and setenv.bat (windows) + * conf - Server configuration files (including server.xml) * logs - Log and output files diff --git a/bin/catalina.bat b/bin/catalina.bat index deea00846..70673a247 100644 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -83,7 +83,12 @@ goto end :okHome rem Get standard environment variables +if "%CATALINA_BASE%" == "" goto gotSetenvHome +if exist "%CATALINA_BASE%\bin\setenv.bat" call "%CATALINA_BASE%\bin\setenv.bat" +goto gotSetenvBase +:gotSetenvHome if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat" +:gotSetenvBase rem Get standard Java environment variables if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath diff --git a/bin/catalina.sh b/bin/catalina.sh index c08a05e62..8bb4f08ae 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -99,7 +99,9 @@ PRGDIR=`dirname "$PRG"` # Only set CATALINA_HOME if not already set [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd` -if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then +if [ -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 -- 2.11.0