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

Hello.

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

From initial /etc/my.cnf :

# 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

[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


.....
    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


....
    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.

File a bug report.

And/or look at this possible workaround I already told you:
https://forums.opensuse.org/showthread.php/530045-Mariadb-general-questions?p=2858123#post2858123

If you already modify mysql-systemd-helper, you could just as well modify to only use my.cnf instead. :wink:

It might be helpful if you posted your modifications though. How should anybody else know what changes you did, that may be crucial to the solution?
Also, you might have made a simple mistake.

>If you already modify mysql-systemd-helper, you could just as well modify to only use my.cnf instead.
Yes I did, but somethings is missing because my modifications does not work.

>Also, you might have made a simple mistake
Sure.

Ok. I am going to restart from beginning and send my modifications and screenshots as soon as possible.

I have open a bug report : https://jira.mariadb.org/browse/MDEV-16030

Sorry, I probably wasn’t clear enough in this regard.
I meant to file a bug report at bugzilla.opensuse.org, I think this helper is very openSUSE specific…

I am sorry. that’s my bug. :cry:

Ok I open an opensuse bug.

Here is mysql-systemd-helper modified script : SUSE Paste

Here it is : 1091084 – Mariadb is unable to follow configurations as defined in /etc/my.cnf for multiple instances

And another one : https://bugzilla.opensuse.org/show_bug.cgi?id=1091465