Bug 633810

Summary: Please add support for setenv.sh to tomcat6, like tomcat5 used to have
Product: Red Hat Enterprise Linux 6 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: tomcat6Assignee: David Knox <dknox>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: azelinka, cperry, dknox, dwalluck, jclere, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 633805 Environment:
Last Closed: 2011-04-18 22:56:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 633805    
Bug Blocks: 623115, 677509    

Description Jan Pazdziora (Red Hat) 2010-09-14 13:09:31 UTC
+++ This bug was initially created as a clone of Bug #633805 +++

Description of problem:

When using Oracle's OCI drivers with Spacewalk, we see segfaults when using PAM with LDAP. The cause seems to be that the OCI driver has its own openldap linked within. We track the problem in bug 623115.

The solution is to LD_PRELOAD the openldap library, thus overriding the ldap_* symbols in the OCI driver.

Looking at the tomcat5's /usr/bin/dtomcat5, it has code

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

or

if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
  . "$CATALINA_HOME"/bin/setenv.sh
fi

in it, depending on exact version. That makes it very easy for us to ship /usr/share/tomcat5/bin/setenv.sh with Spacewalk which just sets the LD_PRELOAD appropriately.

Unfortunately, tomcat6 does not have the code which would slurp in the setenv.sh if it exists. In reads /etc/tomcat6/tomcat6.conf (just like tomcat5 did read tomcat5.conf). However, the file exists and while we could modify it in a %post script, that seems like more volatile approach, compared to shipping the whole setenv.sh file.

I'd appreciate if you could apply the following patch to /usr/bin/tomcat6:

--- /usr/sbin/tomcat6.orig	2009-12-22 05:26:46.000000000 -0500
+++ /usr/sbin/tomcat6	2010-09-14 08:48:23.700088876 -0400
@@ -16,6 +16,10 @@
   . $TOMCAT_CFG
 fi
 
+if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
+  . "$CATALINA_HOME"/bin/setenv.sh
+fi
+
 set_javacmd
 
 # CLASSPATH munging

Version-Release number of selected component (if applicable):

tomcat6-6.0.20-2.fc13.noarch

How reproducible:

Deterministic.

Steps to Reproduce:
1. Look at /usr/sbin/tomcat6 source.
  
Actual results:

There is no sourcing of "$CATALINA_HOME"/bin/setenv.sh.

Expected results:

It should be sourcing "$CATALINA_HOME"/bin/setenv.sh.

Additional info:

Comment 1 Jan Pazdziora (Red Hat) 2010-09-14 13:12:02 UTC
We will face the same problem with Satellite on RHEL 6, therefore we'd appreciate the same fix for RHEL 6. If tomcat6 is likely to have async errata 6.1, we'd like the change to go to the async errata, otherwise to 6.1.

Thank you,

Jan