Mariadb-Server nach fehlerhafter Paketaktualisierung fehlerhaft

1840
Fat Finger

So hatte ich neulich ein Problem, als das Serverpaket von mariadb nicht korrekt aktualisiert wurde und nicht mehr ausgeführt werden konnte.

Log started: 2016-07-19 04:00:34 Setting up mariadb-server-10.1 (10.1.16+maria-1~jessie) ... Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details. invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing package mariadb-server-10.1 (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: mariadb-server-10. Log ended: 2016-07-19 04:00:52 

Die Hauptfehlermeldung war.

root@box{~}:systemctl status mariadb.service ● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: failed (Result: exit-code) since Tue 2016-07-19 04:00:52 PDT; 17s ago Process: 38259 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=227/NO_NEW_PRIVILEGES) Process: 38256 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Process: 38098 ExecStartPre=/bin/sh -c VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) Process: 38073 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Main PID: 38259 (code=exited, status=227/NO_NEW_PRIVILEGES)  Jul 19 04:00:52 box.example.com systemd[38259]: Failed at step NO_NEW_PRIVILEGES spawning /usr/sbin/mysqld: Invalid argument Jul 19 04:00:52 box.example.com systemd[1]: mariadb.service: main process exited, code=exited, status=227/NO_NEW_PRIVILEGES Jul 19 04:00:52 box.example.com systemd[1]: Failed to start MariaDB database server. Jul 19 04:00:52 box.example.com systemd[1]: Unit mariadb.service entered failed state. 

Der Versuch, das Paket zu löschen und erneut zu installieren, konnte das Problem nicht beheben.

There is a MySQL server running, but we failed in our attempts to stop it. Stop it yourself and try again! 

Also versuchte ich es mit einem kleinen Paketverwalter.

dpkg --configure -a  apt-get clean apt-get install -f 

Die Anleitung zur Fehlerbehebung bei Mariadb war besonders hilfreich.

mysqld --help --verbose | grep 'log-error' | tail -1 mysqld --help --verbose | grep 'datadir' | tail -1 

https://mariadb.com/kb/de/mariadb/trugging-installation-issues/

Erst als ich versuchte, perconadb als Alternative zu mariadb zu installieren und zu deinstallieren, bemerkte ich einen Fehler in Bezug auf einen problematischen symbolischen Link, den ich gelöscht und das Problem scheinbar behoben habe.

Preconfiguring packages ... (Reading database ... 72430 files and directories currently installed.) Removing percona-server-server-5.7 (5.7.13-6-1.jessie) ... /usr/bin/deb-systemd-helper: error: unable to link /etc/systemd/system/mysql.service to /dev/null: File exists 
1

1 Antwort auf die Frage

0
Gremble

This problem is linked to the age of the kernel present, a kernel update fixes the problem. e.g. encountered on Debian Stretch with a 3.2 kernel, upgrade to 4.9 (the distribution default) fixes this.