Comment 0 for bug 1691096

Revision history for this message
Andreas Hasenack (ahasenack) wrote : mysql fails to start with systemd 233: failed at step KEYRING

artful unprivileged container on a xenial host

With systemd 233, mysql-server-5.7 in an artful lxd unprivileged container fails to start:

  Process: 6460 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=237/KEYRING)

May 16 12:20:08 artful-mysql systemd[1]: mysql.service: Failed to set invocation ID on control group /system.slice/mysql.service, ignoring: Operation not permitted
(...)
May 16 12:20:08 artful-mysql systemd[6460]: mysql.service: Failed at step KEYRING spawning /usr/share/mysql/mysql-systemd-start: Permission denied

We start with systemd-232:
ubuntu@intense-sunbeam:~$ apt-cache policy systemd
systemd:
  Installed: 232-21ubuntu3
  Candidate: 233-6ubuntu1
  Version table:
     233-6ubuntu1 500
        500 http://br.archive.ubuntu.com/ubuntu artful/main amd64 Packages
 *** 232-21ubuntu3 100
        100 /var/lib/dpkg/status

Then we install mysql-server-5.7:
ubuntu@intense-sunbeam:~$ sudo apt install mysql-server-5.7
...
Setting up mysql-server-5.7 (5.7.17-0ubuntu1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Processing triggers for libc-bin (2.24-9ubuntu2) ...
Processing triggers for systemd (232-21ubuntu3) ...

Which starts just fine:
ubuntu@intense-sunbeam:~$ mysql -uroot -psecret
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
...

We then upgrade systemd:
ubuntu@intense-sunbeam:~$ sudo apt install systemd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libpam-systemd libsystemd0
(...)
Setting up libpam-systemd:amd64 (233-6ubuntu1) ...

mysql is still running:
ubuntu@intense-sunbeam:~$ mysql -uroot -psecret
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
(...)

But restarting mysql fails:
ubuntu@intense-sunbeam:~$ sudo service mysql restart
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
ubuntu@intense-sunbeam:~$ mysql -uroot -psecret
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

More logs attached.