Bug 971615 - Tomcat plugin ignores processes if container running as 'rhq' user
Tomcat plugin ignores processes if container running as 'rhq' user
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.5
Unspecified Unspecified
unspecified Severity medium (vote)
: GA
: RHQ 4.10
Assigned To: Jean-frederic Clere
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-06 19:17 EDT by Elias Ross
Modified: 2014-04-23 08:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-23 08:29:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch for 7e512faae456 (7.75 KB, application/mbox)
2013-06-19 14:51 EDT, 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 12:10 EST, Thomas Segismont
no flags Details | Diff

  None (edit)
Description Elias Ross 2013-06-06 19:17:32 EDT
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 14:51:15 EDT
Created attachment 763102 [details]
Patch for 7e512faae456

Lots of whitespace cleanup, sorry. Tested against Tomcat 7.
Comment 2 John Mazzitelli 2013-11-12 12:27:21 EST
putting on the potential list of RHQ 4.10 fixes
Comment 3 Thomas Segismont 2013-11-14 12:10:27 EST
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 12:15:41 EST
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 09:44:01 EST
merged in master by 003b64a68d29f99c134749e6c9d7db8e8e61837c
Comment 6 Thomas Segismont 2013-11-28 10:05:58 EST
Reviewed and merged by Jean-Frederic (see Comment 5)
Comment 7 Heiko W. Rupp 2014-04-23 08:29:54 EDT
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.