Bug 784652 - Sort out agent user and process user
Summary: Sort out agent user and process user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Documentation
Version: JON 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: JON 3.1.0
Assignee: Deon Ballard
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-25 16:59 UTC by Deon Ballard
Modified: 2013-09-11 10:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-11 10:59:19 UTC
Type: ---


Attachments (Terms of Use)
agent and resource users (26.38 KB, application/vnd.oasis.opendocument.text)
2012-05-29 16:32 UTC, Deon Ballard
no flags Details
reviews Agent user docs (20.80 KB, application/vnd.oasis.opendocument.text)
2012-06-06 17:42 UTC, Ian Springer
no flags Details

Description Deon Ballard 2012-01-25 16:59:36 UTC
There was a recent question on the rhq-users list about how process discovery and management worked, depending on the agent user and the process user on the system.

This needs to be investigated for some server types, like JBAS, Apache, Tomcat, etc.

For the recent JVM monitoring that Ian worked on, the agent must be running as the same user as the JVM or as root for the JVM to be discovered.

Comment 1 Ian Springer 2012-01-26 03:20:00 UTC
I spent some time investigating this this afternoon. The results were a bit surprising.

I started to JBAS6, Tomcat6, and Apache2 instances as root, and then tried to discover them with an Agent running as a regular user. Apache was discovered, but JBAS and Tomcat were not, which surprised me. Looking at the code for the AS4 and AS5 plugins, I can tell we intended to support discovering AS servers running as other users, but alas it doesn't work; I would consider it a bug. I think Tomcat falls in the same boat - I can't think of any reason why we should not be able to discover Tomcat processes running as other users. We discover Apache and Postgres processes running as other users with no issues.

As for Process Resources, I was able to manually add Process Resources corresponding to processes running as root with no problems, even though my Agent was running as a regular user.

I think we need BZ's for fixing the AS4, AS5, and Tomcat plugins, so they are able to discover server instances running as different users. This should not be a huge effort either.

Comment 2 Ian Springer 2012-01-26 16:22:19 UTC
I've done some further investigation, and it turns out it's not as bad as I thought. AS4 and AS5 can be discovered even when running as a different user than the Agent, but only if the Agent can read the AS instance's run.jar file (e.g. /home/bob/Applications/jboss/bin/run.jar). On Unix systems this means the Agent user must have execute/search permission on all ancestor directories of run.jar, i.e.:

/home/
/home/bob/
/home/bob/Applications/
/home/bob/Applications/jboss/
/home/bob/Applications/jboss/bin/

and it also must have read permission for the run.jar file itself.

The search permissions requirement is not obvious, except for Unix gurus.

We should improve our logging in the AS4 and AS5 plugins, so they log informative warnings in cases where run.jar cannot be accessed, e.g.:

[WARN] /home/bob/Applications/jboss/bin/run.jar is not accessible. Please make sure the file is readable by the user the Agent is running as (ips). In addition, make sure all of its ancestor directories (/home/, /home/bob/, /home/bob/Applications/, /home/bob/Applications/jboss/, and /home/bob/Applications/jboss/bin/) are executable/searchable by ips.

I'll create a BZ for adding this improved logging.

As for Tomcat, it does not discover Tomcat instances running as other users, even when the Agent can read all files in the Tomcat install. I consider this a bug, and I'll create a BZ for it.

Comment 3 Deon Ballard 2012-02-29 18:51:42 UTC
Setting the target to 3.1.

Comment 4 Deon Ballard 2012-02-29 19:00:08 UTC
Somewhat related, see bug 790753.

Comment 6 Deon Ballard 2012-05-29 16:30:10 UTC
Assigning to Ian for review.

Comment 7 Deon Ballard 2012-05-29 16:32:32 UTC
Created attachment 587447 [details]
agent and resource users

Ian,

Just review the docs, mark it up (track changes should be on), and re-attach it here. 

If anything is missing, insert a note, and I'll write the new content.

Thanks!
Deon

P.S. As per normal, I haven't spell-checked yet. I always do that last, after all the changes are done.

Comment 8 Ian Springer 2012-06-06 17:42:54 UTC
Created attachment 589964 [details]
reviews Agent user docs


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