Bug 536427 (RHQ-778)

Summary: Postgres is not autodiscoverable when run as as a different user from the agent process
Product: [Other] RHQ Project Reporter: Jeff Weiss <jweiss>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: low    
Version: 1.0.1CC: cwelton, dajohnso
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-778
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
RHEL, fedora, postgres 8.2.6, 8.2.9
Last Closed: 2013-09-02 03:21:25 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 535842    
Bug Blocks:    

Description Jeff Weiss 2008-09-02 11:09:00 EDT
I have not been able to get postgres to be auto-discoverable when run as postgres user.  I have been able to add it manually after RHQ-253 was fixed.  

How to repeat:
Run postgres and RHQ agent on the same machine, with postgres and agent running as different users (I used postgres as postgres, and the agent as jweiss).  When you import the newly discovered inventory from the agent, the postgres server will not be among the servers discovered.
Comment 1 Jason Dobies 2008-09-02 15:36:32 EDT
FYI, this works for me in HEAD as of Sept 2 at about 3:30pm. My postgres instance runs as the postgres user and my agent is running under jdob. I saw the postgres instance inventoried.
Comment 2 Jeff Weiss 2008-09-02 16:25:21 EDT
I'm sure this has nothing to do with rev# at this point.  Greg says it worked for him too and I think that was on an older rev than I am running.  I believe there's a environmental difference, we need to figure out what it is.   Is there some debug output that might shed light on where it's going wrong for me?

Comment 3 Mark Burchard 2009-01-13 12:01:07 EST
Different postgres installations have different file permissions for the postgres "data" directory.  At least in the case of the postgres 8.3.5 package from enterprisedb, the perms on "data" are set to 700, meaning that postgresql.conf can only be read by the postgres user or root.  The version of postgres-server that comes down from fedora910 and rhel5  yum sets 700 on the /var/lib/pgsql directory (one level above where the enterprisedb version sets 700), even more restrictive.

Under these conditions, the postgres instance is discovered and inventoried, but the inability to read data/postgresql.conf throws an error in the logs and limits the information available about the postgres config.
Comment 4 Red Hat Bugzilla 2009-11-10 16:16:42 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-778
Comment 5 Corey Welton 2010-10-06 23:10:49 EDT
sunil, take a quick look at this one.  it can probably be closed but let's see.
Comment 6 Sunil Kondkar 2010-10-19 06:37:29 EDT
Verified on rhq build#423

started postgres and RHQ agent on the same machine, with postgres and agent running as different users. Postgres is auto discovered and imported successfully.
Comment 7 Heiko W. Rupp 2013-09-02 03:21:25 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.