Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
After installation of pcp-pmda-postgresql this PMDA does not collect statistics from a PostgreSQL instance due to a SELinux issue.
Version-Release number of selected component (if applicable):
pcp-5.0.2-5.el8
selinux-policy-3.14.3-41.el8
How reproducible:
Always
Steps to Reproduce:
1. Install RHEL-8.2 release
2. Install RPMs of pcp, pcp-pmda-postgresql, postgresql-server
3. Start the postgresql server and pmcd
4. Install PMDA
# cd /var/lib/pcp/pmdas/postgresql
# ./Install
Actual results:
* Installation throws errors:
[Mon Apr 20 10:21:08] pmdapostgresql(87409) Info: Connecting to host 'local', port '5432', db 'postgres' as user 'postgres'
[Mon Apr 20 10:21:08] pmdapostgresql(87409) Info: Error connecting to db postgres as user postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
* Only one postgres metric is reported as active after the installation:
Check postgresql metrics have appeared ... 1 warnings, 1 metrics and 0 values
* /var/log/pcp/pmcd/postgresql.log contains error messages:
[Mon Apr 20 10:56:23] pmdapostgresql(64495) Info: Error connecting to db postgres as user postgres: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
* "ausearch -m AVC" reports AVCs
type=AVC msg=audit(04/20/2020 10:15:43.559:1167) : avc: denied { write } for pid=71727 comm=python3 name=.s.PGSQL.5432 dev="tmpfs" ino=66228 scontext=system_u:system_r:pcp_pmcd_t:s0tcontext=system_u:object_r:postgresql_var_run_t:s0 tclass=sock_file permissive=0
* after the PMDA installation "pminfo -f postgresql" fails with an error message
postgresql: pmLookupName: No PMCD agent for domain of request
* "audit2allow -a" reports the following missing SELinux rule:
#============= pcp_pmcd_t ==============
allow pcp_pmcd_t postgresql_var_run_t:sock_file write;
Expected results:
* No AVC errors reported
* No error messages during the installation
* Collection of statistics works and "pminfo -f postgresql" shows real values.
Description of problem: After installation of pcp-pmda-postgresql this PMDA does not collect statistics from a PostgreSQL instance due to a SELinux issue. Version-Release number of selected component (if applicable): pcp-5.0.2-5.el8 selinux-policy-3.14.3-41.el8 How reproducible: Always Steps to Reproduce: 1. Install RHEL-8.2 release 2. Install RPMs of pcp, pcp-pmda-postgresql, postgresql-server 3. Start the postgresql server and pmcd 4. Install PMDA # cd /var/lib/pcp/pmdas/postgresql # ./Install Actual results: * Installation throws errors: [Mon Apr 20 10:21:08] pmdapostgresql(87409) Info: Connecting to host 'local', port '5432', db 'postgres' as user 'postgres' [Mon Apr 20 10:21:08] pmdapostgresql(87409) Info: Error connecting to db postgres as user postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? * Only one postgres metric is reported as active after the installation: Check postgresql metrics have appeared ... 1 warnings, 1 metrics and 0 values * /var/log/pcp/pmcd/postgresql.log contains error messages: [Mon Apr 20 10:56:23] pmdapostgresql(64495) Info: Error connecting to db postgres as user postgres: could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? * "ausearch -m AVC" reports AVCs type=AVC msg=audit(04/20/2020 10:15:43.559:1167) : avc: denied { write } for pid=71727 comm=python3 name=.s.PGSQL.5432 dev="tmpfs" ino=66228 scontext=system_u:system_r:pcp_pmcd_t:s0tcontext=system_u:object_r:postgresql_var_run_t:s0 tclass=sock_file permissive=0 * after the PMDA installation "pminfo -f postgresql" fails with an error message postgresql: pmLookupName: No PMCD agent for domain of request * "audit2allow -a" reports the following missing SELinux rule: #============= pcp_pmcd_t ============== allow pcp_pmcd_t postgresql_var_run_t:sock_file write; Expected results: * No AVC errors reported * No error messages during the installation * Collection of statistics works and "pminfo -f postgresql" shows real values.