Bug 971615

Summary: Tomcat plugin ignores processes if container running as 'rhq' user
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: PluginsAssignee: Jean-frederic Clere <jclere>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5CC: hrupp, mazz, tsegismo
Target Milestone: GA   
Target Release: RHQ 4.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-23 12:29:54 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
Patch for 7e512faae456
none
Don't skip the discovery process if distinct users run the managed server and the agent. none

Description Elias Ross 2013-06-06 23:17:32 UTC
Steps to reproduce:

Start Tomcat (7) as non-root user (e.g. 'tomcat'); start RHQ as non-root user.

This is for 4.5.1, maybe working on a later version?

diff --git a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java b/modules/plugins/tomc
index 542f212..b348fca 100644
--- a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java
+++ b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java
@@ -226,12 +226,6 @@ private DiscoveredResourceDetails parseTomcatProcess(ResourceDiscoveryContext co
         ProcessInfo processInfo = autoDiscoveryResult.getProcessInfo();
         String[] commandLine = processInfo.getCommandLine();
 
-        if (null == processInfo.getExecutable()) {
-            log.debug("Ignoring Tomcat instance (agent may not be owner) with following command line: "
-                + Arrays.toString(commandLine));
-            return null;
-        }
-
         if (!isStandalone(commandLine) && !isWindows(context)) {
             log.debug("Ignoring embedded Tomcat instance (catalina.home not found) with following command line: "
                 + Arrays.toString(commandLine));

Comment 1 Elias Ross 2013-06-19 18:51:15 UTC
Created attachment 763102 [details]
Patch for 7e512faae456

Lots of whitespace cleanup, sorry. Tested against Tomcat 7.

Comment 2 John Mazzitelli 2013-11-12 17:27:21 UTC
putting on the potential list of RHQ 4.10 fixes

Comment 3 Thomas Segismont 2013-11-14 17:10:27 UTC
Created attachment 824050 [details]
Don't skip the discovery process if distinct users run the managed server and the agent.

Other middleware plugins (ie AS7) do not prevent such a scenario.

Comment 4 Thomas Segismont 2013-11-14 17:15:41 UTC
Jean-Frederic,

I've assigned the BZ to you so that you can review and merge the patch provided. Please note the original patch is from Elias who deserves the credit (he has already signed the CLA).

Thanks,
Thomas

Comment 5 Jean-frederic Clere 2013-11-28 14:44:01 UTC
merged in master by 003b64a68d29f99c134749e6c9d7db8e8e61837c

Comment 6 Thomas Segismont 2013-11-28 15:05:58 UTC
Reviewed and merged by Jean-Frederic (see Comment 5)

Comment 7 Heiko W. Rupp 2014-04-23 12:29:54 UTC
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.