Skip to content

Commit

Permalink
Fix bug 43594. Use setenv from CATALINA_BASE (if set) in preference t…
Browse files Browse the repository at this point in the history
…o 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
  • Loading branch information
markt-asf committed Dec 1, 2007
1 parent ffbbe88 commit 709bb3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RUNNING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions bin/catalina.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion bin/catalina.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 709bb3e

Please sign in to comment.