Bug 141434

Summary: cannot start mysqld
Product: [Fedora] Fedora Reporter: Florin Andrei <florin>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: jpenix
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:07:22 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 Florin Andrei 2004-12-01 02:23:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
yum'ed up mysql-server, then as root tried to "/etc/init.d/mysql start".
It failed, and the errors were:

Nov 30 18:18:22 rivendell mysql_install_db: Preparing db table
Nov 30 18:18:22 rivendell mysql_install_db: Preparing host table
Nov 30 18:18:22 rivendell mysql_install_db: Preparing user table
Nov 30 18:18:22 rivendell mysql_install_db: Preparing func table
Nov 30 18:18:22 rivendell mysql_install_db: Preparing tables_priv table
Nov 30 18:18:22 rivendell mysql_install_db: Preparing columns_priv table
Nov 30 18:18:22 rivendell mysql_install_db: Installing all prepared tables
Nov 30 18:18:22 rivendell kernel: audit(1101867502.447:0): avc: 
denied  { read } for  pid=3614 exe=/usr/libexec/mysqld
path=/tmp/sh-thd-1101867567 (deleted) dev=hda4 ino=736026
scontext=root:system_r:mysqld_t tcontext=root:object_r:tmp_t
tclass=fileNov 30 18:18:22 rivendell mysql_install_db: 041130 18:18:22
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: /usr/libexec/mysqld:
Shutdown Complete
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: To start mysqld at boot
time you have to copy support-files/mysql.server
Nov 30 18:18:22 rivendell mysql_install_db: to the right place for
your system
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: PLEASE REMEMBER TO SET A
PASSWORD FOR THE MySQL root USER !
Nov 30 18:18:22 rivendell mysql_install_db: This is done with:
Nov 30 18:18:22 rivendell mysql_install_db: /usr/bin/mysqladmin -u
root  password 'new-password'
Nov 30 18:18:22 rivendell mysql_install_db: /usr/bin/mysqladmin -u
root -h rivendell.home.local  password 'new-password'
Nov 30 18:18:22 rivendell mysql_install_db: See the manual for more
instructions.
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: You can start the MySQL
daemon with:
Nov 30 18:18:22 rivendell mysql_install_db: cd /usr ;
/usr/bin/safe_mysqld &
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: You can test the MySQL
daemon with the benchmarks in the 'sql-bench' directory:
Nov 30 18:18:22 rivendell mysql_install_db: cd sql-bench ; run-all-tests
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: Please report any problems
with the /usr/bin/mysqlbug script!
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysql_install_db: The latest information
about MySQL is available on the web at
Nov 30 18:18:22 rivendell mysql_install_db: http://www.mysql.com
Nov 30 18:18:22 rivendell mysql_install_db: Support MySQL by buying
support/licenses at https://order.mysql.com
Nov 30 18:18:22 rivendell mysql_install_db:
Nov 30 18:18:22 rivendell mysqld: Initializing MySQL database:  succeeded
Nov 30 18:18:22 rivendell kernel: audit(1101867502.695:0): avc: 
denied  { append } for  pid=3645 exe=/usr/libexec/mysqld
path=/var/log/mysqld.log dev=hda4 ino=3729729
scontext=root:system_r:mysqld_t tcontext=root:object_r:var_log_t
tclass=file
Nov 30 18:18:22 rivendell kernel: audit(1101867502.696:0): avc: 
denied  { append } for  pid=3645 exe=/usr/libexec/mysqld
path=/var/log/mysqld.log dev=hda4 ino=3729729
scontext=root:system_r:mysqld_t tcontext=root:object_r:var_log_t
tclass=file
Nov 30 18:18:32 rivendell mysqld: Starting MySQL:  failed


Version-Release number of selected component (if applicable):
selinux-policy-targeted-1.17.30-2.34

How reproducible:
Always

Steps to Reproduce:
1.install mysql-server
2.start the mysql service
3.
    

Actual Results:  it fails
Nov 30 18:22:15 rivendell kernel: audit(1101867735.240:0): avc: 
denied  { append } for  pid=3775 exe=/usr/libexec/mysqld
path=/var/log/mysqld.log dev=hda4 ino=3729729
scontext=root:system_r:mysqld_t tcontext=root:object_r:var_log_t
tclass=file
Nov 30 18:22:15 rivendell kernel: audit(1101867735.240:0): avc: 
denied  { append } for  pid=3775 exe=/usr/libexec/mysqld
path=/var/log/mysqld.log dev=hda4 ino=3729729
scontext=root:system_r:mysqld_t tcontext=root:object_r:var_log_t
tclass=file

Expected Results:  mysqld should run fine

Additional info:

Comment 1 Daniel Walsh 2004-12-01 13:45:47 UTC
First off /var/log/mysqld.log is labeled incorrectly.  It should be
mysqld_log_t.  You can execute restorecon /var/log/mysqld.log to fix
this. I don't know how it got mislabeled.

The initialization of the mysql database has been reported and is
being worked on.  Hopefully a new version of mysqld will be available
shortly.  For the time being you can execute
setenforce 0
mysql_install_db
setenforce 1 
and everything should work.


Comment 2 Florin Andrei 2004-12-02 02:26:42 UTC
Thanks Daniel, your suggestions worked.
Just running restorecon /var/log/mysqld.log was not enough, i had to
also go through the initialization procedure you described
(setenforce...).

Now mysql seems to be working fine.

Comment 3 Daniel Walsh 2004-12-02 15:50:25 UTC

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

Comment 4 Stuart Clark 2004-12-06 06:04:08 UTC
I am running mysql-server-4.1.7-0FC3 rpms from mysql.com, along with
mysql-shared-compat-3.23.58-1 rpm created against instructions that
can be found at fedoranews.org.  

I encountered this problem when after yum upgrading various rpms,  I
do not know when it broke or how.  Doing the initialisation procedurs
described in comment #1
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=141434#c1 fixed
this problem.

Comment 5 Red Hat Bugzilla 2006-02-21 19:07:22 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.