Bug 971615 - Tomcat plugin ignores processes if container running as 'rhq' user
Summary: Tomcat plugin ignores processes if container running as 'rhq' user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: GA
: RHQ 4.10
Assignee: Jean-frederic Clere
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-06 23:17 UTC by Elias Ross
Modified: 2014-04-23 12:29 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-04-23 12:29:54 UTC
Embargoed:


Attachments (Terms of Use)
Patch for 7e512faae456 (7.75 KB, application/mbox)
2013-06-19 18:51 UTC, Elias Ross
no flags Details
Don't skip the discovery process if distinct users run the managed server and the agent. (10.22 KB, patch)
2013-11-14 17:10 UTC, Thomas Segismont
no flags Details | Diff

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.


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