Bug 1031872 - SELinux is preventing /usr/sbin/mysqld from 'open' accesses on the file /var/log/mysqld.log.
SELinux is preventing /usr/sbin/mysqld from 'open' accesses on the file /var/...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
: 1031866 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2013-11-18 22:07 EST by sergio
Modified: 2013-11-19 01:52 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-19 01:52:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description sergio 2013-11-18 22:07:05 EST
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.
# /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.
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 01:47:22 EST
*** Bug 1031866 has been marked as a duplicate of this bug. ***
Comment 2 Miroslav Grepl 2013-11-19 01:52:18 EST
You will need to fix /var/log/mysqld.log labeling.

Please execute

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

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