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:


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.