Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16030

mysql-systemd-helper does not follow config file directives with multiple instances

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 10.0.34
    • N/A
    • Configuration
    • Opensuse leap 42.3 x86_64 rpm install

    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

      Attachments

        1. journald.txt
          6 kB
          jean-claude dole
        2. my.cnf
          3 kB
          jean-claude dole
        3. my1.cnf
          0.6 kB
          jean-claude dole

        Activity

          People

            Unassigned Unassigned
            jcdole jean-claude dole
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.