mysql fails to start because of multiple apparmor profiles

Bug #403898 reported by payman
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apparmor (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

mysql fails to start after upgrade...should be related to apparmor since I'm not using the default data directory for mysql.

ProblemType: Package
Architecture: i386
DistroRelease: Ubuntu 9.04
ErrorMessage: subprocess post-installation script returned error exit status 1
Package: mysql-server-5.0 5.1.30really5.0.75-0ubuntu10.2
SourcePackage: mysql-dfsg-5.0
Title: package mysql-server-5.0 5.1.30really5.0.75-0ubuntu10.2 failed to install/upgrade: subprocess post-installation script returned error exit status 1
Uname: Linux 2.6.28-13-generic i686

Revision history for this message
payman (peymandelshad) wrote :
Revision history for this message
Mathias Gug (mathiaz) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Relevant error message:

Setting up mysql-server-5.0 (5.1.30really5.0.75-0ubuntu10.2) ...

 * Stopping MySQL database server mysqld

   ...done.

 * Reloading AppArmor profiles ...

   ...done.

 * Starting MySQL database server mysqld

   ...fail!

invoke-rc.d: initscript mysql, action "start" failed.

dpkg: error processing mysql-server-5.0 (--configure):

 subprocess post-installation script returned error exit status 1

Could you please provide the following information:

 * content of /var/log/daemon.log related to mysql processes:

    /var/log/daemon.log

 * apparmor audit messages related to mysqld:

    /var/log/kern.log

 * mysqld apparmor profile:

    /etc/apparmor.d/usr.sbin.mysqld

 * mysql configuration stripped of private information (such as password):

    /etc/mysql/my.cnf

 * extra mysql configuration from the conf.d directory:

    /etc/mysql/conf.d/

Changed in mysql-dfsg-5.0 (Ubuntu):
status: New → Incomplete
Revision history for this message
payman (peymandelshad) wrote :
Revision history for this message
payman (peymandelshad) wrote :
Revision history for this message
payman (peymandelshad) wrote :
Revision history for this message
payman (peymandelshad) wrote :
Revision history for this message
payman (peymandelshad) wrote :

I attached all you asked for! ;)
My /etc/mysql/conf.d/ is empty.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Could attach a listing of the datadir directory?

 $ ls -l /home/payman/Web/MySQL/data/

Is the directory above located on a network filesystem (nfs, cifs, etc...) or network device (DRBD, iscsi) ?

Revision history for this message
payman (peymandelshad) wrote :

No, the datadir is located in my local disk drive.

Revision history for this message
payman (peymandelshad) wrote :

Ok, I solved the problem!
It's an apparmor issue. It had newly created two files in /etc/apparmor.d :
usr.sbin.mysqld.dpkg-dist
usr.sbin.mysqld.new

For some reason the override the settings in usr.sbin.mysqld, so mysql didn't have permissions needed to run.
I just needed to delete those files and restart apparmor and mysql.

But this is still a bug in apparmor. Would be nice to assign in to someone in the dev team.

Revision history for this message
payman (peymandelshad) wrote :

Other people seem to suffer from the same problem:
http://ubuntuforums.org/showthread.php?p=7773061

Mathias Gug (mathiaz)
summary: - package mysql-server-5.0 5.1.30really5.0.75-0ubuntu10.2 failed to
- install/upgrade: subprocess post-installation script returned error exit
- status 1
+ mysql fails to start because of multiple apparmor profiles
affects: mysql-dfsg-5.0 (Ubuntu) → apparmor (Ubuntu)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

usr.sbin.mysqld.dpkg-dist will be ignored automatically, but usr.sbin.mysqld.new was created by the user and therefore apparmor has no idea of knowing which profile to use as the correct one (the binary is taken from inside the profile, not the name of the file itself).

Changed in apparmor (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
antonio manuel (ac26649) wrote :

I partially solved the problem with a script
#!/bin/bash
 sudo /etc/init.d/apparmor stop
 sudo /etc/init.d/mysql restart
 mysql -u root -p
--------------------------------------
partially because when I work with mySQL I have to stop AppArmor.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Antonio, please do not disable all of AppArmor-- there are a lot of profiles protecting your system that are unrelated to mysql. Please see https://wiki.ubuntu.com/DebuggingApparmor for details on how to temporarily or permanently disable the problematic profile, as well as how to debug it. If it is found this is a problem with the profile, please file a different bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.