Bug 998478

Summary: SELinux is preventing /usr/sbin/nginx from read, write access on the file nginx.pid.
Product: [Fedora] Fedora Reporter: 747500
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:39bdd3ee4216c1cfcbe8d1d5d2bfe663b60ba5107de69af87b4e2bbb751abb7b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-20 08:55:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description 747500 2013-08-19 12:10:51 UTC
Description of problem:
SELinux is preventing /usr/sbin/nginx from read, write access on the file nginx.pid.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that nginx should be allowed read write access on the nginx.pid file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep nginx /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                nginx.pid [ file ]
Source                        nginx
Source Path                   /usr/sbin/nginx
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           nginx-1.4.2-1.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-69.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.9.5-301.fc19.x86_64 #1 SMP Tue
                              Jun 11 19:39:38 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-08-16 18:38:31 MSK
Last Seen                     2013-08-16 18:38:31 MSK
Local ID                      a85d3169-0bdc-49b8-9b21-28dbcf8010f9

Raw Audit Messages
type=AVC msg=audit(1376663911.645:526): avc:  denied  { read write } for  pid=4815 comm="nginx" name="nginx.pid" dev="tmpfs" ino=249179 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file


type=AVC msg=audit(1376663911.645:526): avc:  denied  { open } for  pid=4815 comm="nginx" path="/run/nginx.pid" dev="tmpfs" ino=249179 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1376663911.645:526): arch=x86_64 syscall=open success=yes exit=EINTR a0=7fe781999b74 a1=42 a2=1a4 a3=0 items=0 ppid=1 pid=4815 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=nginx exe=/usr/sbin/nginx subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: nginx,httpd_t,var_run_t,file,read,write

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.9.5-301.fc19.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-08-20 08:55:45 UTC
Please execute

# restorecon -R -v /var/run/nginx*

to fix this problem.