[debian-mysql] Bug#983563: mariadb-server: trigger fails when systemd is not running (eg. chroot)

Arnaud Rebillout arnaudr at kali.org
Fri Feb 26 09:39:41 GMT 2021


Package: mariadb-server-10.5
Version: 1:10.5.8-3
Severity: normal
Tags: patch
User: devel at kali.org
Usertags: origin-kali

Dear Maintainer,

part of Kali Linux CI, we run install & upgrades of Kali metapackages
on a regular basis.  This is done in containers, hence systemd is not
running.

Lately we got a failure from the mariadb-server package:

  Processing triggers for mariadb-server-10.5 (1:10.5.8-3) ...
  System has not been booted with systemd as init system (PID 1). Can't operate.
  Failed to connect to bus: Host is down
  dpkg: error processing package mariadb-server-10.5 (--configure):
   installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 1

In this run, the package mysql-common was upgraded, which triggered
mariadb-server, as expected:

  $ cat debian/mariadb-server-10.5.triggers
  interest-noawait /etc/mysql
  interest-noawait /etc/systemd/system/mariadb.service.d

Looking at the mariadb-server postinst file though, we can see that the
script checks if systemctl is installed, but it doesn't check if systemd
is actually running:

  https://salsa.debian.org/mariadb-team/mariadb-10.5/-/blob/master/debian/mariadb-server-10.5.postinst#L241

Hence I believe that the line:

  if [ -x "$(command -v systemctl)" ]; then

Should be replaced by:

  if [ -d /run/systemd/system ]; then

(as is done a few lines below in the script).

Best,

  Arnaud



More information about the pkg-mysql-maint mailing list