Hello.

Mariadb is unable to follow configurations as defined in /etc/my.cnf

From initial /etc/my.cnf :
Code:
# If you want to use mysqld_multi uncomment 1 or more mysqld sections
# below or add your own ones.

# WARNING
# --------
# If you uncomment mysqld1 than make absolutely sure, that database mysql,
# configured above, is not started.  This may result in corrupted data!
#
# [mysqld1]
# port       = 3306
# datadir    = /var/lib/mysql
# pid-file   = /var/lib/mysql/mysqld.pid
# socket     = /var/lib/mysql/mysql.sock
# user       = mysql

# [mysqld2]
# port       = 3307
# datadir    = /var/lib/mysql-databases/mysqld2
# pid-file   = /var/lib/mysql-databases/mysqld2/mysql.pid
# socket     = /var/lib/mysql-databases/mysqld2/mysql.sock
# user       = mysql

.....
.....
.....
from mysql@.service
Code:
[Unit]
Description=MySQL server - %I instance
Wants=basic.target
PartOf=mysql.target
After=basic.target network.target syslog.target

[Service]
Restart=on-abort
Type=simple
ExecStartPre=/usr/lib/mysql/mysql-systemd-helper  install %i
ExecStartPre=/usr/lib/mysql/mysql-systemd-helper  upgrade %i
ExecStart=/usr/lib/mysql/mysql-systemd-helper     start   %i
ExecStartPost=/usr/lib/mysql/mysql-systemd-helper wait    %i

[Install]
WantedBy=multi-user.target
From mysql-systemd-helper which is called with the instance number

Multiple instances problem 1 : datadir path does not follow what could be in /etc/my.cnf
Code:
.....
    if [[ -z "$INSTANCE" ]]; then
        datadir=/var/lib/mysql
        socket="/var/run/mysql/mysql.sock"
    else
        datadir="/var/lib/mysql-$INSTANCE"
        socket="/var/run/mysql/mysql.${INSTANCE}.sock"
    fi
.....
Multiple instances problem 2 : /etc/my.cnf is not read
Code:
....
    if [[ -n "$INSTANCE" ]]; then
        opts="$(/usr/bin/my_print_defaults mysqld mysqld_multi "$INSTANCE")"
        tmp_opts="$opts"
        config="/etc/my${INSTANCE}.cnf"
    else
        opts="$(/usr/bin/my_print_defaults mysqld)"
        tmp_opts="$opts"
        config="/etc/my.cnf"
    fi
....
This point can be solved by splitting mysqld% from /etc/my.cnf in /etc/my${INSTANCE}.cnf even if I prefer to have every things in the same file.

But for the first problem what can I do ?

I have modified mysql-systemd-helper to read datadir, and socket from /etc/my.cnf (for [mysqld%] )
But it seems not to be enough.

Any help is welcome.