[MDEV-16030] mysql-systemd-helper does not follow config file directives with multiple instances Created: 2018-04-25  Updated: 2018-07-02  Resolved: 2018-07-02

Status: Closed
Project: MariaDB Server
Component/s: Configuration
Affects Version/s: 10.0.34
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: jean-claude dole Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: need_feedback
Environment:

Opensuse leap 42.3 x86_64 rpm install


Attachments: Text File journald.txt     File my.cnf     File my1.cnf    

 Description   

Mariadb is unable to follow configurations as defined in /etc/my.cnf
Extract of the file 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 from mysql@.service

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

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
{color:#d04437}        datadir="/var/lib/mysql-$INSTANCE"
        socket="/var/run/mysql/mysql.${INSTANCE}.sock"
{color}   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"
        {color:#d04437}config="/etc/my${INSTANCE}.cnf"{color}
    else
        opts="$(/usr/bin/my_print_defaults mysqld)"
        tmp_opts="$opts"
        config="/etc/my.cnf"
    fi
....

Multiple instances problem 3 : /etc/my.cnf is not read
If one try to configure an instance ( say instance 1 ) in /etc/my1.cnf, a new database is not installed in the right datadir because it is hard-coded in mysql-systemd-helper .
Of course the folder '/var/lib/mysql' does not exists because it is not _in use by the config.
See journald.txt

/etc/my.cnf : see attached file



 Comments   
Comment by Elena Stepanova [ 2018-05-31 ]

mysql-systemd-helper doesn't belong to MariaDB, you need to report it to openSUSE.

Generated at Thu Feb 08 08:25:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.