3
September
2020
AppArmor service does not start after installing MySQL - problem solution
11:35

AppArmor service does not start after installing MySQL - problem solution

3 September 2020 11:35

For diagnostic purposes, I have boot-time messages enabled in /etc/default/grub (line GRUB_CMDLINE_LINUX=""
).
When starting a computer running Linux Mint 19.2, errors like FAILED Failed to start AppArmor are visible. The problem started after reinstalling the MySQL service to manage relational databases. The solution to the "Failed to start AppArmor" problem is given below...

One solution is to add the AppArmor abstractions file for mysql:
/etc/apparmor.d/abstractions/mysql
to which you need to add lines as indicated in article.

  • This method didn't work for me.

Command diagnostics journalctl -xe
indicated the reason for this behavior by AppArmor:

Sep 03 10:46:37 mypc apparmor[4313]: AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld

The reason is an incorrect mysqld service profile for the AppArmor service, which is contained in the /etc/apparmor.d/usr.sbin.mysqld file.

My solution:

You need to disable the AppArmor service for the mysqld service using the following two commands.

cd /etc/apparmor.d/disable
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld usr.sbin.mysqld

Launched the AppArmor service.

sudo systemctl start apparmor.service

There are no more errors.

sudo systemctl status apparmor.service

Sep 03 11:12:21 mypc systemd[1]: Starting AppArmor initialization...
Sep 03 11:12:30 imypc systemd[1]: Started AppArmor initialization.

The mysql service also does not produce an error:

sudo systemctl status mysql

Sep 03 11:14:47 mypc systemd[1]: Starting MySQL Community Server...
Sep 03 11:14:52 mypc systemd[1]: Started MySQL Community Server.


I came up with a solution by analogy, having studied the contents of the /etc/apparmor.d/disable folder:
usr.bin.firefox -> /etc/apparmor.d/usr.bin.firefox
usr.sbin.rsyslogd -> /etc/apparmor.d/usr.sbin.rsyslogd



Related publications