Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 900665 (JBPAPP6-1032)

Summary: EAP 6 init script from RPM install fails to operate when machine is also running apache
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Graeme Gillies <ggillies>
Component: BuildAssignee: Permaine Cheung <pcheung>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.0.0CC: cristiano.nicolai, ggillies, pcheung, twells
Target Milestone: ---   
Target Release: EAP 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBPAPP6-1032
Whiteboard: eap601candidate
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
JBoss EAP6 RPMs on RHEL 6.3 x86_64 jbossas-standalone-7.1.2-8.Final_redhat_1.ep6.el6.noarch java-1.6.0-openjdk httpd 2.2.17-15.4.ep5.el6
Last Closed: 2012-10-16 02:43: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:
Attachments:
Description Flags
init_output.log none

Description Graeme Gillies 2012-06-26 01:33:16 UTC
project_key: JBPAPP6

Hi,

We have jboss eap6 running on a rhel6.3 machine, with an apache httpd deamon also running on the box using proxypass to proxy requests through to EAP. This is a very standard setup which is used a lot, but unfortunately, because of the way the jboss init script is written, it doesn't work in this environment.

This is because the init script checks to see if port 8080 is in use using netstat, and if it is, it bails out. In the environment above, you will sometimes have stale connections from apache to the (now not running) eap instance showing up in netstat, causing the init script to (incorrectly) think it's already running.

Also, if you change from port 8080, the init script still blindly checks that port anyway.

The init script needs to be rewritten to work better. It should not be relying on netstat output nor should it be relying on netstat output nor should it be relying on greping logs to determine if jboss has started or not. These are terrible ways to determine what's going (what if I change my logging configuration? then I break the init script).

The init script should just be storing a pid file of the java process that it launches in /var/run, and then just checking that the process with that pid is gone upon execution of service shutdown. You can kill -15 to gracefully init the shutdown to jboss without having to use any scripts, and after say 2 minutes just kill -9 the process if it hasn't shutdown by then.

For startup, a different heuristic is needed to determine if jboss has started correctly or not. Ideally jboss itself could just touch a file in /var/run when it has deployed correctly (maybe with some stats on the amount of errors) that the init script could check for in order to determine when it as started. This would need code change from jboss (perhaps a new module or modification to the core) but it would divorce init script workings from being dependant on logging configuration.

At the very least this needs to be fixed to work correctly with httpd, as this basic deployment case (eap with apache front doored) is incredibly common and going to affect a lot of people

Comment 1 Graeme Gillies 2012-06-26 01:35:16 UTC
This is the log file showing the debug output of the current init script and how it fails with httpd also running on the box

Comment 2 Graeme Gillies 2012-06-26 01:35:16 UTC
Attachment: Added: init_output.log


Comment 3 Permaine Cheung 2012-06-26 19:11:22 UTC
We have been using this machanism since EAP 5, but as you mentioned, if the port has changed, it will still be checked. It seems like we can get rid of that check if stale connections are stopping the starting of jboss, and let jboss handle that itself.

Regarding checking of the process running, there are times that a process is running but pid file went missing, so we also check if there's a process running using the script that start these services.

The stopping of the service is doing what you described.

The same check as in EAP 5 was done when starting jboss, until there is better way to determine if service is started, that's what we can do for now.










Comment 4 Graeme Gillies 2012-06-27 01:30:57 UTC
Hi,

That makes sense.

Can we at least get the init script fixed so that running jboss with httpd doesn't cause problems. This is holding up our deployments.

Regards,

Graeme

Comment 5 Rajesh Rajasekaran 2012-07-11 20:01:15 UTC
Labels: Added: eap601candidate


Comment 6 Permaine Cheung 2012-09-13 12:43:30 UTC
Fix committed, will be in EAP 6.0.1 ER2.

Comment 7 Pavel Janousek 2012-10-02 08:07:55 UTC
Link: Added: This issue relates to JBPAPP-9364


Comment 8 Pavel Janousek 2012-10-02 08:09:16 UTC
/etc/init.d/jbossas and /etc/init.d/jbossas-domain were rewritten.

Verified during 6.0.1-ER2 test cycle, rewritten behavior seems working, closing...

Comment 9 Tom WELLS 2012-10-04 08:47:33 UTC
Does this need a release note for EAP 6.0.1? The issue needs to be re-opened if it does, and the release notes flags set (Affects Release Notes, Not Yet Documented).

Comment 10 Pavel Janousek 2012-10-04 09:05:46 UTC
@Tom,

I think none is needed in RN because behavior and customer's usage is the same as previous, there is only an internal implementation modification(s), but for safety - Permaine could confirm my thought.

Comment 11 Permaine Cheung 2012-10-04 12:38:12 UTC
I agree with Pavel.

Comment 12 Tom WELLS 2012-10-08 05:59:41 UTC
Updated release notes fields.

Comment 13 Tom WELLS 2012-10-08 05:59:41 UTC
Release Notes Docs Status: Added: Not Required


Comment 14 Dana Mison 2012-10-16 02:43:35 UTC
Writer: Added: tomwells


Comment 15 Anne-Louise Tangring 2012-11-13 20:12:05 UTC
Release Notes Docs Status: Removed: Not Required 
Writer: Removed: tomwells 
Docs QE Status: Removed: NEW