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.
Bug 1394199 - pmlogger_daily cron job failed due to Permission denied by SELinux mismatch
Summary: pmlogger_daily cron job failed due to Permission denied by SELinux mismatch
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcp
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Nathan Scott
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-11 11:46 UTC by Kenjiro Nakayama
Modified: 2019-12-16 07:21 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-14 07:08:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kenjiro Nakayama 2016-11-11 11:46:41 UTC
Description of problem:

pmlogger_daily cron job failed due to Permission denied by SELinux mismatch

Version-Release number of selected component (if applicable):

- pcp-3.11.3-4.el7.x86_64
- cat /etc/redhat-release 
  Red Hat Enterprise Linux Server release 7.2 (Maipo)


How reproducible:

Steps to Reproduce:
0. setenforce 1
1. yum -y install pcp
2. systemctl start pmcd.service pmlogger.service   
3. Run cron in /etc/cron.d/pcp-pmlogger
   ->  10     0  *  *  *  pcp  /usr/libexec/pcp/bin/pmlogger_daily -X xz -x 3

Actual results:

Failed to run above cron due to these errors:

- In /var/log/pcp/pmlogger/<HOST>/pmlogger.log:

  pmlogger: error creating primary logger socket symbolic link /var/run/pcp/pmlogger.primary.socket: Permission denied

- In /var/log/audit/audit.log:

  type=AVC msg=audit(1478864472.026:351788): avc:  denied  { create } for  pid=113260 comm="pmlogger" name="pmlogger.primary.socket" scontext=system_u:system_r:pcp_pmlogger_t:s0-s0:c0.c1023 tcontext=system_u:object_r:pcp_var_run_t:s0 tclass=lnk_file

Expected results:

- No error and pmlogger_daily runs without error.

Additional info:

- We confimed that "setenforce 0" fixed this issue, but we need to enable SELinux.
- Current labeles are below. I chnaged some patterns like system_u:system_r:pcp_pmlogger_t, but they were not worked.

  # ls -alZ /var/run/pcp/
  drwxrwxr-x. pcp  pcp  system_u:object_r:pcp_var_run_t:s0 .
  drwxr-xr-x. root root system_u:object_r:var_run_t:s0   ..
  -r--r--r--. root root system_u:object_r:pcp_var_run_t:s0 pmcd.pid
  srw-rw-rw-. root root system_u:object_r:pcp_var_run_t:s0 pmcd.socket
  srw-rw-rw-. pcp  pcp  system_u:object_r:pcp_var_run_t:s0 pmlogger.114168.socket

Comment 2 Kenjiro Nakayama 2016-11-14 07:08:54 UTC
I'm sorry! This issue has been fixed in new selinux-policy package (selinux-policy-3.13.1-102.el7_3.4.noarch). 
I close this ticket.


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