Bug 755256 - Mysql server service fails to load with selinux enforcing
Summary: Mysql server service fails to load with selinux enforcing
Keywords:
Status: CLOSED DUPLICATE of bug 753816
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 16
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Tom Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-20 05:01 UTC by Thomas Drake-Brockman
Modified: 2011-11-21 07:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-21 07:37:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Last 50 lines of /var/log/messages after service failed to load. (23 bytes, text/plain)
2011-11-20 05:04 UTC, Thomas Drake-Brockman
no flags Details
Last 50 lines of /var/log/audit/audit.log after service failed to load. (23 bytes, text/plain)
2011-11-20 05:05 UTC, Thomas Drake-Brockman
no flags Details

Description Thomas Drake-Brockman 2011-11-20 05:01:32 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2

When I attempt to start the mysql service (either by using the service or systemctl commands) it fails. On inspection of system logs it apears that selinux is preventing mysql form loading. This is confirmed as it works with selinux set on permissive.

Reproducible: Always

Steps to Reproduce:
1. setenforce 1
2. yum install mysql-server
3. service mysqld start OR systemctl start mysqld.service
Actual Results:  
`systemctl start mysqld.service` returns:
"Job failed. See system logs and 'systemctl status' for details."

`systectl status mysqld.service` returns:
"mysqld.service - MySQL database server
	  Loaded: loaded (/lib/systemd/system/mysqld.service; disabled)
	  Active: failed since Sun, 20 Nov 2011 12:58:16 +0800; 1min 9s ago
	 Process: 7319 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
	 Process: 8146 ExecStart=/usr/bin/mysqld_safe --nowatch --basedir=/usr (code=exited, status=127)
	 Process: 8130 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir (code=exited, status=0/SUCCESS)
	Main PID: 7318 (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/mysqld.service"

Expected Results:  
`systemctl start mysqld.service` should return with no output.

`systectl status mysqld.service` should return:
"mysqld.service - MySQL database server
	  Loaded: loaded (/lib/systemd/system/mysqld.service; disabled)
	  Active: active (running) since Sun, 20 Nov 2011 12:59:54 +0800; 31s ago
	 Process: 8354 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
	 Process: 8203 ExecStart=/usr/bin/mysqld_safe --nowatch --basedir=/usr (code=exited, status=0/SUCCESS)
	 Process: 8187 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir (code=exited, status=0/SUCCESS)
	Main PID: 8353 (mysqld)
	  CGroup: name=systemd:/system/mysqld.service
		  └ 8353 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-fil..."

This is a fresh DVD install of Fedora 16 x86_64 installed yesterday.

Comment 1 Thomas Drake-Brockman 2011-11-20 05:04:38 UTC
Created attachment 534622 [details]
Last 50 lines of /var/log/messages after service failed to load.

Comment 2 Thomas Drake-Brockman 2011-11-20 05:05:20 UTC
Created attachment 534623 [details]
Last 50 lines of /var/log/audit/audit.log after service failed to load.

Comment 3 John J. McDonough 2011-11-20 21:13:59 UTC
FWIW - the problem can be resolved by following the instructions in SETroubleshoot, but that doesn't make it any less of a bug:

allow this access for now by executing:
# grep mysqld_safe /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Comment 4 Honza Horak 2011-11-21 07:37:21 UTC

*** This bug has been marked as a duplicate of bug 753816 ***

Comment 5 Honza Horak 2011-11-21 07:45:31 UTC
This issue should be fixed by https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-56.fc16
Feel free to re-open it if the problem persists.


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