5

After a routine update yesterday, MariaDB would not start because a shared library file is not loading because it is being blocked by apparmor.

Here's the output from the journalctl -xe

Apr 17 11:44:45 pbts-academic audit[10349]: AVC apparmor="DENIED" operation="file_mmap" profile="/usr/sbin/mysqld" name="/usr/lib/x86_64-linux-gnu/liblz4.so.1.7.1"
Apr 17 11:44:45 pbts-academic kernel: audit: type=1400 audit(1555472685.956:79): apparmor="DENIED" operation="file_mmap" profile="/usr/sbin/mysqld" name="/usr/lib/x86_64-linux-gnu/liblz4.so.1.7.1"
Apr 17 11:44:45 pbts-academic mysqld[10349]: /usr/sbin/mysqld: error while loading shared libraries: liblz4.so.1: failed to map segment from shared object
Apr 17 11:44:45 pbts-academic systemd[1]: mariadb.service: Main process exited, code=exited, status=127/n/a
Apr 17 11:44:45 pbts-academic systemd[1]: mariadb.service: Failed with result 'exit-code'.
Apr 17 11:44:45 pbts-academic systemd[1]: Failed to start MariaDB 10.3.14 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is RESULT.

Thanks in advance.

  • Possible duplicate of https://askubuntu.com/questions/916009/mysql-wont-start-because-of-apparmor – YetiCGN Jun 27 '19 at 16:40

1 Answers1

0

Add the lines to /etc/apparmor.d/usr.sbin.mysqld (or /etc/apparmor.d/usr.sbin.mysqld.local)

/usr/lib/x86_64-linux-gnu/liblz4.so* rm,

rm, no not deleting, allows apparmor to read and memory map the file, which is what MariaDB needs to load a shared library.

danblack
  • 111