Bug 899457 (JBEWS-249)
Summary: | JAVA_OPTS in /etc/tomcat6/tomcat6.conf get added twice | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Web Server 1 | Reporter: | James Livingston <jlivings> | |
Component: | unspecified | Assignee: | Permaine Cheung <pcheung> | |
Status: | CLOSED NEXTRELEASE | QA Contact: | ||
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | EWS 1.0.1 | CC: | dknox, jlivings, joallen | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
URL: | http://jira.jboss.org/jira/browse/JBEWS-249 | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 899458 (view as bug list) | Environment: |
RHEL 5, probably other RHEL versions
|
|
Last Closed: | 2011-09-22 20:36:40 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
James Livingston
2011-07-19 02:12:40 UTC
Adding JAVA_OPTS in /etc/sysconfig/tomcat6 works correctly, adding it once This is because the following fragment is in both /etc/init.d/tomcat6 and /usr/sbin/tomcat6, so it is executed once by the service wrapper, which then calls the latter script and that runs the configuration file again. TOMCAT_CFG="/etc/tomcat6/tomcat6.conf" if [ -r "$TOMCAT_CFG" ]; then . $TOMCAT_CFG fi A simple fix would be to drop that section from /etc/init.d/tomcat6. However that means that the global configuration there overrides the per-service configuration in /etc/sysconfig/${NAME}, which is almost certainly the wrong way around. If it was dropped from /usr/sbin/tomcat6, then it would mean the no configuration file is read if someone starts tomcat6 outside the service wrapper. Assigning to Dave. This will be fixed as recent cves are applied to the tomcat6 builds over the week of 7/18. The problem occurs because /usr/sbin/tomcat6 redundantly sources tomcat6.conf. The diffs below show the solution being tested.
{code:title=/usr/sbin/tomcat6}
RCS file: /cvs/dist/rpms/tomcat6/RHEL-4-EP-5/tomcat6-6.0.wrapper,v
retrieving revision 1.4
diff -r1.4 tomcat6-6.0.wrapper
10,22d9
< LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
<
< # Get the tomcat config (use this for environment specific settings)
< if [ -z "${TOMCAT_CFG}" ]; then
< TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
< fi
<
< if [ -r "$TOMCAT_CFG" ]; then
< . $TOMCAT_CFG
< fi
<
< JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
<
{code}
{code:title=tomcat6.conf}
RCS file: /cvs/dist/rpms/tomcat6/RHEL-4-EP-5/tomcat6-6.0.conf,v
retrieving revision 1.4
diff -r1.4 tomcat6-6.0.conf
30a31,34
> LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
>
> JAVA_OPTS="${JAVA_OPTS} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
>
{code}
Additional consideration of cases when sbin/tomcat6 is used directly, here is new diff for sbin/tomcat6. The caller must define $NAME at least.
RCS file: /cvs/dist/rpms/tomcat6/RHEL-4-EP-5/tomcat6-6.0.wrapper,v
retrieving revision 1.4
diff -r1.4 tomcat6-6.0.wrapper
10,18c10,23
< LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
<
< # Get the tomcat config (use this for environment specific settings)
< if [ -z "${TOMCAT_CFG}" ]; then
< TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
< fi
<
< if [ -r "$TOMCAT_CFG" ]; then
< . $TOMCAT_CFG
---
> # The wrapper can't be used by itself. The NAME variable must be set by
> # the caller. The first argument in the command line must be one of
> # "start, stop, start-security, or version"
>
> if [ "$2" == "stand-alone" ]; then
> if [ -z "${TOMCAT_CFG}" ]; then
> TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
> fi
> if [ -r "${TOMCAT_CFG}" ]; then
> . ${TOMCAT_CFG}
> fi
> if [ -r "/etc/sysconfig/${NAME}" ]; then
> . /etc/sysconfig/${NAME}
> fi
21,22d25
< JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
<
{code}
Sorry about the spam. After testing the changes, they became increasingly kludgey. The tomcat wrapper (sbin/tomcat6) was not intended to be called alone, and shouldn't source the config files. Instructions for creating additional service instances are in /etc/sysconfig/tomcat6. The block that read tomcat6.conf in sbin/tomcat6 will be removed completely. fixed in tomcat6-6.0.32-18_patch_04.ep5.el4 Workaround Description: Added: Remove the following lines from /usr/sbin/tomcat6 {code} # Get the tomcat config (use this for environment specific settings) if [ -z "${TOMCAT_CFG}" ]; then TOMCAT_CFG="/etc/tomcat6/tomcat6.conf" fi if [ -r "$TOMCAT_CFG" ]; then . $TOMCAT_CFG fi {code} Release Notes Text: Added: /usr/sbin/tomcat6 no longer sources tomcat6.conf Release Notes Text: Removed: /usr/sbin/tomcat6 no longer sources tomcat6.conf Docs QE Status: Removed: NEW |