http://bugzilla.novell.com/show_bug.cgi?id=1002662 Bug ID: 1002662 Summary: Tomcat Lacks "setenv.sh" Implementation Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.2 Hardware: Other OS: SLES 12 Status: NEW Severity: Major Priority: P5 - None Component: Other Assignee: bnc-team-screening@forge.provo.novell.com Reporter: adam.jerome@microfocus.com QA Contact: qa-bugs@suse.de CC: adam.jerome@microfocus.com Depends on: 1002639 Found By: --- Blocker: --- +++ This bug was initially created as a clone of Bug #1002639 +++ Inconsistency in the openSUSE implementation of tomcat. To help identify this inconsistency, I will quote a section from the upstream documentation https://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt : ++++++++++++++++++++ Begin Quote +++++++++++++++++++++++++++++++++ (3.4) Using the "setenv" script (optional, recommended) Apart from CATALINA_HOME and CATALINA_BASE, all environment variables can be specified in the "setenv" script. The script is placed either into CATALINA_BASE/bin or into CATALINA_HOME/bin directory and is named setenv.bat (on Windows) or setenv.sh (on *nix). The file has to be readable. By default the setenv script file is absent. If the script file is present both in CATALINA_BASE and in CATALINA_HOME, the one in CATALINA_BASE is preferred. For example, to configure the JRE_HOME and CATALINA_PID variables you can create the following script file: On Windows, %CATALINA_BASE%\bin\setenv.bat: set "JRE_HOME=%ProgramFiles%\Java\jre7" exit /b 0 On *nix, $CATALINA_BASE/bin/setenv.sh: JRE_HOME=/usr/java/latest CATALINA_PID="$CATALINA_BASE/tomcat.pid" The CATALINA_HOME and CATALINA_BASE variables cannot be configured in the setenv script, because they are used to locate that file. All the environment variables described here and the "setenv" script are used only if you use the standard scripts to launch Tomcat. For example, if you have installed Tomcat as a service on Windows, the service wrapper launches Java directly and does not use the script files. ++++++++++++++++++++++ End Quote +++++++++++++++++++++++++++++++++ As per the instructions above, I created the file %CATALINA_BASE/bin/setenv.sh [specifically: /usr/share/tomcat/bin/setenv.sh]. In this file, I placed several environmental variable settings. Then, I executed the command ./catalina.sh start. This action should have caused an access to my setenv.sh file, and set the several environmental variables. What I found is that the file was not accessed. Assuming that it is a bug, I created a work-around that seems to fix the problem for me: +++++++++++++++++ Begin Diff (/etc/tomcat/tomcat.conf) +++++++++++ diff --git a/tomcat.conf b/tomcat.conf index a90461f..b58e618 100644 --- a/tomcat.conf +++ b/tomcat.conf @@ -46,6 +46,12 @@ SHUTDOWN_VERBOSE="false" # If you wish to further customize your tomcat environment, # put your own definitions here # (i.e. LD_LIBRARY_PATH for some jdbc drivers) + +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 # Clear work directory when tomcat is stopped or restarted CLEAR_WORK="false" +++++++++++++++++ End Diff (/etc/tomcat/tomcat.conf) +++++++++++++ Of course, rather than having NetIQ customers implement this fix manually, it would be better if something similar were released by SLES as a bug fix. -- You are receiving this mail because: You are on the CC list for the bug.