Comment 0 for bug 1011702

Revision history for this message
Aymeric (mulx) wrote :

Hi,
Mysql can't start, on my Ubuntu 12.04. There is an error in a apparmor profile.

You could found the fail case, and a "workaround" to getting it work.

Running as root:
# service mysql start
start: Job failed to start
(in log) init: mysql pre-start process (6912) terminated with status 1

While investigating I found this error:
# /lib/init/apparmor-profile-load usr.sbin.mysqld
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 44: Could not open 'local/usr.sbin.mysqld'
# debsums -a mysql-server-5.5 |grep apparmor
/etc/apparmor.d/usr.sbin.mysqld OK

At this point I made a backup of original /etc/apparmor.d/usr.sbin.mysqld to /etc/apparmor.d/usr.sbin.mysqld.orig and I had a space like the diff show.

# diff /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/usr.sbin.mysqld.orig
44c44
< # include <local/usr.sbin.mysqld>
---
> #include <local/usr.sbin.mysqld>
# /lib/init/apparmor-profile-load usr.sbin.mysqld
# echo $?
0

Trying to running mysql service again give no error
# service mysql start
mysql start/running, process 7994

And debsums failed:
# debsums -a mysql-server-5.5 |grep apparmor
/etc/apparmor.d/usr.sbin.mysqld FAILED

Validating that mysql-server is loaded:
$ mysql -u root -p <<< status
Enter password:
--------------
mysql Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (i686) using readline 6.2

Connection id: 122
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.22-0ubuntu1-log (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 2 min 31 sec

Threads: 1 Questions: 351 Slow queries: 0 Opens: 491 Flush tables: 1 Open tables: 121 Queries per second avg: 2.324
--------------

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: mysql-server-5.5 5.5.22-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.39-generic 3.2.16
Uname: Linux 3.2.0-24-generic i686
ApportVersion: 2.0.1-0ubuntu8
Architecture: i386
Date: Mon Jun 11 18:10:24 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
Logs.var.log.daemon.log:

Logs.var.log.kern.log:
 Jun 11 18:05:28 petita-laptop kernel: [ 6531.054669] type=1400 audit(1339430728.531:24): apparmor="STATUS" operation="profile_load" name="/usr/sbin/mysqld" pid=3683 comm="apparmor_parser"
 Jun 11 18:05:37 petita-laptop kernel: [ 6540.444943] type=1400 audit(1339430737.923:25): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=3695 comm="apparmor_parser"
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: False
ProcEnviron:
 LANGUAGE=
 TERM=xterm
 PATH=(custom, user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: mysql-5.5
UpgradeStatus: Upgraded to precise on 2012-04-27 (45 days ago)