Bug 1031872

Summary: SELinux is preventing /usr/sbin/mysqld from 'open' accesses on the file /var/log/mysqld.log.
Product: [Fedora] Fedora Reporter: sergio <sderaco>
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, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:45e0a78e5fe29f6fedfb4897117ba4b465d3254b24b46babcc0cabe4c26d00aa
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-19 06:52:18 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 sergio 2013-11-19 03:07:05 UTC
Description of problem:
while starting mysqld service (in error) after a cold boot 
SELinux is preventing /usr/sbin/mysqld from 'open' accesses on the file /var/log/mysqld.log.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/var/log/mysqld.log default label should be mysqld_log_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/log/mysqld.log

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that mysqld should be allowed open access on the mysqld.log 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 mysqld /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:mysqld_t:s0
Target Context                unconfined_u:object_r:var_log_t:s0
Target Objects                /var/log/mysqld.log [ file ]
Source                        mysqld
Source Path                   /usr/sbin/mysqld
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           mysql-community-server-5.6.14-3.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-74.11.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.8-200.fc19.x86_64 #1 SMP Wed
                              Nov 13 16:29:59 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-11-18 23:15:59 ART
Last Seen                     2013-11-18 23:56:21 ART
Local ID                      6405145d-9d73-4eaa-991d-352b7d6448e5

Raw Audit Messages
type=AVC msg=audit(1384829781.712:110): avc:  denied  { open } for  pid=3167 comm="mysqld" path="/var/log/mysqld.log" dev="dm-1" ino=794944 scontext=system_u:system_r:mysqld_t:s0 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file


type=SYSCALL msg=audit(1384829781.712:110): arch=x86_64 syscall=open success=no exit=EACCES a0=131b260 a1=441 a2=1b6 a3=5c00 items=0 ppid=2839 pid=3167 auid=4294967295 uid=27 gid=27 euid=27 suid=27 fsuid=27 egid=27 sgid=27 fsgid=27 ses=4294967295 tty=(none) comm=mysqld exe=/usr/sbin/mysqld subj=system_u:system_r:mysqld_t:s0 key=(null)

Hash: mysqld,mysqld_t,var_log_t,file,open

Additional info:
reporter:       libreport-2.1.9
hashmarkername: setroubleshoot
kernel:         3.11.8-200.fc19.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-11-19 06:47:22 UTC
*** Bug 1031866 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2013-11-19 06:52:18 UTC
You will need to fix /var/log/mysqld.log labeling.

Please execute

# restorecon -R -v /var/log/mysqld.log