Mariadb103 available

Hi @stephdl,

after installing nethserver-mariadb103 for installing Drupal we get the same errors as @michelandre reported here including the long install time and service down. The error occurs on a fresh VM too.

The mysqld status shows the rh-mariadb103-mariadb status instead of the default mariadb 5?

[root@testserver ~]# systemctl status mysqld
● rh-mariadb103-mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/rh-mariadb103-mariadb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2020-08-28 18:43:30 CEST; 2s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 8127 ExecStartPre=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-prepare-db-dir %n (code=exited, status=1/FAILURE)
  Process: 8099 ExecStartPre=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
  Process: 8093 ExecStartPre=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /usr/bin/scl_enabled rh-mariadb103 (code=exited, status=0/SUCCESS)
 Main PID: 2559
   CGroup: /system.slice/mysqld.service
           ├─2559 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─2734 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

Aug 28 18:43:29 testserver.domain.local systemd[1]: Starting MariaDB 10.3 database server...
Aug 28 18:43:30 testserver.domain.local systemd[1]: rh-mariadb103-mariadb.service: control process exited, code=exited status=1
Aug 28 18:43:30 testserver.domain.local systemd[1]: Failed to start MariaDB 10.3 database server.
Aug 28 18:43:30 testserver.domain.local systemd[1]: Unit rh-mariadb103-mariadb.service entered failed state.
Aug 28 18:43:30 testserver.domain.local systemd[1]: rh-mariadb103-mariadb.service failed.

/var/log/messages:

Database MariaDB is not initialized, but the directory /var/opt/rh/rh-mariadb103/lib/mysql is not empty, so initialization cannot be done
Make sure the /var/opt/rh/rh-mariadb103/lib/mysql is empty before running mysql-prepare-db-dir

After deleting the directory and restarting it works:

rm /var/opt/rh/rh-mariadb103/lib/mysql/*
signal-event nethserver-rh-mariadb103-save

I compared installs of nethserver-rh-mariadb102 and 103 and I think the services are linked wrong, mysql and mysqld are somehow linked to rh-mariadb103-mariadb.

Nethserver-rh-mariadb103 creates 3 links on installation

Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/rh-mariadb103-mariadb.service.
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/rh-mariadb103-mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/rh-mariadb103-mariadb.service to /usr/lib/systemd/system/rh-mariadb103-mariadb.service.

whereas Nethserver-rh-mariadb102 only creates 1:

Created symlink from /etc/systemd/system/multi-user.target.wants/rh-mariadb102-mariadb.service to /usr/lib/systemd/system/rh-mariadb102-mariadb.service.

Here are the wrong symlinks:

[root@testserver ~]# ls -lisa /etc/systemd/system/mysql*.service
33657745 0 lrwxrwxrwx 1 root root 53 Aug 28 18:22 /etc/systemd/system/mysqld.service -> /usr/lib/systemd/system/rh-mariadb103-mariadb.service
33657744 0 lrwxrwxrwx 1 root root 53 Aug 28 18:22 /etc/systemd/system/mysql.service -> /usr/lib/systemd/system/rh-mariadb103-mariadb.service

I don’t know where they come from…do you have an idea? I think the wrong symlinks are causing the bad initialization of the mariadb103.

2 Likes