RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 593721 - implement tomcat6 resource agent since RHEL6 does not have tomcat5
Summary: implement tomcat6 resource agent since RHEL6 does not have tomcat5
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Marek Grac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 591003 637802
Blocks: 614127 614130
TreeView+ depends on / blocked
 
Reported: 2010-05-19 15:09 UTC by Marek Grac
Modified: 2016-04-26 13:42 UTC (History)
6 users (show)

Fixed In Version: resource-agents-3.0.12-14.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 591003
: 614127 614130 (view as bug list)
Environment:
Last Closed: 2010-11-10 22:15:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marek Grac 2010-05-19 15:09:22 UTC
+++ This bug was initially created as a clone of Bug #591003 +++

Description of problem:

Errors in the file /usr/share/cluster/tomcat-5.sh resource script, part of rgmanager, that leaves the script unusable.


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

rgmanager-2.0.52-6.el5

How reproducible:

Always


Steps to Reproduce:
1. Use the attached /etc/cluster/cluster.conf


2. Use the attached /etc/tomcat5/tomcat5.conf


3. Use the attached /etc/tomcat5/server.xml



4.- start cluster services cman and rgmanager

service cman start
service rgmanager start

5.- Use "rg_test" to enable the Artifactory01 service

rg_test test /etc/cluster/cluster.conf start service Artifactory01

  
Actual results:

1.- "rg_test" says the Service is started, when it doesn't. There are no java processess running on the system

2.- Checking /etc/cluster/tomcat-5/tomcat-5:Artifactory01/logs/catalina.out the problem is due to a problem with the "su" invocation line at /usr/share/cluster/tomcat-5.sh resource script:

su "$TOMCAT_USER" -c "$JAVA_HOME/bin/java" $JAVA_OPTS $OCF_RESKEY_catalina_options \
                -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
                -Dcatalina.base="$TOMCAT_gen_catalina_base" \
                -Dcatalina.home="$CATALINA_HOME" \
                -Djava.io.tmpdir="$CATALINA_TMPDIR" \
                org.apache.catalina.startup.Bootstrap "$@" start \
                >> "$TOMCAT_gen_catalina_base"/logs/catalina.out 2>&1 &


Changing it to the following it is fixed:

 su "$TOMCAT_USER"  -c " \"$JAVA_HOME/bin/java\" $JAVA_OPTS $OCF_RESKEY_catalina_options \
                -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
                -Dcatalina.base=\"$TOMCAT_gen_catalina_base\" \
                -Dcatalina.home=\"$CATALINA_HOME\" \
                -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
                org.apache.catalina.startup.Bootstrap \"$@\" start " \
                >> "$TOMCAT_gen_catalina_base"/logs/catalina.out 2>&1 &


3.- There are errors in the parsing of the generated server.xml file in catalina.out  ue to its usage of commented lines in the "sha1_addToFile" function defined in the /usr/share/cluster/utils/config-utils.sh file:

sha1_addToFile()
{
        declare sha1line="# rgmanager-sha1 $(sha1sum "$1")"
        echo $sha1line >> "$1"
}

Adding the following function to /usr/share/cluster/utils/config-utils.sh will fix it:

sha1_addToFileXML()
{
        declare sha1line="<!--\n# rgmanager-sha1 $(sha1sum "$1") \n-->"
        echo -e $sha1line >> "$1"
}

Also it is necessary to change the line of /usr/share/cluster/tomcat-5.sh

        sha1_addToFile "$generated_file"

to the following:

        sha1_addToFileXML "$generated_file"

4.- Changing the the file /etc/tomcat5/server.xml causes the tomcat-5.sh resource script re-generate its own server.xml file located at /etc/cluster/tomcat-5/tomcat-5:Artifactory01/conf/server.xml, but the regeneration concatenates the contents with the previous file causing more parsing errors in catalina.out . This is due to the "generate_config_file" function located in /usr/share/cluster/tomcat-5.sh

generate_config_file()
{
	declare original_file="$1"
	declare generated_file="$2"
	declare ip_addresses="$3"

	if [ -f "$generated_file" ]; then
		sha1_verify "$generated_file"
		if [ $? -ne 0 ]; then
			clog_check_sha1 $CLOG_FAILED
			return 0
		fi
	fi	

	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"

#	generate_configTemplate "$generated_file" "$original_file"
	$(dirname $0)/utils/tomcat-parse-config.pl $ip_addresses < "$original_file" >> "$generated_file"

        sha1_addToFile "$generated_file"
	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
               
	return 0;
}


Changing it to the following will fix it:

generate_config_file()
{
	declare original_file="$1"
	declare generated_file="$2"
	declare ip_addresses="$3"

	if [ -f "$generated_file" ]; then
		sha1_verify "$generated_file"
		if [ $? -ne 0 ]; then
			clog_check_sha1 $CLOG_FAILED
		else
			return 0
		fi
		
	fi	

	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"

#	generate_configTemplate "$generated_file" "$original_file"
	$(dirname $0)/utils/tomcat-parse-config.pl $ip_addresses < "$original_file" > "$generated_file"

        sha1_addToFileXML "$generated_file"
	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
               
	return 0;
}


Expected results:

1.- Detection of Tomcat not starting. In this case we used "rg_test", so it's a minot bug

2.- No errors, Tomcat started

3.- No parsing errors in catalina.out

4.- No parsing errors in catalina.out

Additional info:

--- Additional comment from rmicmirregs on 2010-05-11 03:39:15 EDT ---

Created an attachment (id=413058)
Cluster.conf, tomcat5.conf, server.xml

Comment 2 RHEL Program Management 2010-06-07 16:03:41 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 8 Marek Grac 2010-07-13 18:01:24 UTC
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
We do not support multiple instance of tomcat6 on cluster.

Comment 9 Marek Grac 2010-07-14 07:42:03 UTC
Deleted Technical Notes Contents.

Old Contents:
We do not support multiple instance of tomcat6 on cluster.

Comment 15 Dean Jansa 2010-08-24 14:41:06 UTC
[root@marathon-01 doc]# cd /usr/share/cluster/
[root@marathon-01 cluster]# ls tomcat-6*
tomcat-6.metadata  tomcat-6.sh


Tomcat-6 agent installed in latest tree

Comment 16 releng-rhel@redhat.com 2010-11-10 22:15:54 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.