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

mariadbd-multi: server does not start when its group in ~/.my.cnf or /etc/my.cnf sets mysqld=, mysqladmin= or ledir=

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      A server started by mariadbd-multi does not start if its group, for example [mysqld2], sets which binaries mariadbd-multi should use: mysqld= (server binary), mysqladmin= (admin tool) or ledir= (where mariadbd-safe finds the server). This happens when the group is in one of the standard option files: /etc/my.cnf, ~/.my.cnf or MYSQL_HOME/my.cnf

      The same groups work when the file is given with --defaults-file

      Test case

      BASEDIR=/test/MD031126-mariadb-10.11.20-linux-x86_64-opt
      TMPDIR=/tmp/i4d
      export HOME=$TMPDIR PATH=$BASEDIR/bin:$PATH
      unset MYSQL_HOME MARIADB_HOME
      mkdir -p $TMPDIR/itmp
      $BASEDIR/scripts/mariadb-install-db --no-defaults --basedir=$BASEDIR --datadir=$TMPDIR/d2 --tmpdir=$TMPDIR/itmp --auth-root-authentication-method=normal >/dev/null 2>&1
      cat > $TMPDIR/multi.cnf <<EOC
      [mysqld_multi]
      mysqladmin=$BASEDIR/bin/mariadb-admin
      user=root
      [mysqld2]
      mysqld=$BASEDIR/bin/mariadbd
      datadir=$TMPDIR/d2
      socket=$TMPDIR/s2
      log-error=$TMPDIR/e2.err
      skip-networking
      EOC
       
      echo "== 1. group in ~/.my.cnf"
       
      cp $TMPDIR/multi.cnf $TMPDIR/.my.cnf
      mariadbd-multi --no-log start 2 2>&1 | f >/dev/null; sleep 5
      mariadbd-multi --no-log report 2 2>&1 | f
      grep -o "unknown variable.*" $TMPDIR/e2.err
      mariadbd-multi --no-log stop 2 >/dev/null 2>&1; sleep 5
       
      echo "== 2. same group, file given with --defaults-file"
       
      rm $TMPDIR/.my.cnf $TMPDIR/e2.err
      mariadbd-multi --defaults-file=$TMPDIR/multi.cnf --no-log start 2 2>&1 | f >/dev/null; sleep 5
      mariadbd-multi --defaults-file=$TMPDIR/multi.cnf --no-log report 2 2>&1 | f
      grep -o "unknown variable.*" $TMPDIR/e2.err
      mariadbd-multi --defaults-file=$TMPDIR/multi.cnf --no-log stop 2 >/dev/null 2>&1; sleep 5
       
      mariadb-admin --no-defaults -uroot --socket=$TMPDIR/s2 shutdown >/dev/null 2>&1; 
      rm -rf $TMPDIR
      

      == 1. group in ~/.my.cnf
      Reporting MariaDB servers
      MariaDB server from group: mysqld2 is not running
      unknown variable 'mysqld=/test/MD031126-mariadb-10.11.20-linux-x86_64-opt/bin/mariadbd'
      == 2. same group, file given with --defaults-file
      Reporting MariaDB servers
      MariaDB server from group: mysqld2 is running
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5h
                0.5h

                Git Integration

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