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

mysqld_safe bug with --basedir option

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Cannot Reproduce
    • 10.1.9
    • N/A
    • OTHER
    • None
    • Linux (Any)

    Description

      When running multiple instances of mariadb, if mysqld_safe is passed the "basedir" option, it will fail to start the second instance of mariadb with:

      [zimbra@zre-ldap005 ~]$ /opt/zimbra/common/bin/mysqld_safe --basedir=/opt/zimbra/common --defaults-file=/opt/zimbra/conf/antispam-my.cnf --external-locking --malloc-lib=/opt/zimbra/common/lib/libtcmalloc_minimal.so --datadir=/opt/zimbra/data/amavisd/mysql/data --log-error=/opt/zimbra/log/antispam-mysqld.log --ledir=/opt/zimbra/common/sbin
      151230 14:57:42 mysqld_safe Adding '/opt/zimbra/common/lib/libtcmalloc_minimal.so' to LD_PRELOAD for mysqld
      151230 14:57:43 mysqld_safe Logging to '/opt/zimbra/log/antispam-mysqld.log'.
      151230 14:57:43 mysqld_safe A mysqld process already exists

      Removing the --basedir option allows it to successfully start:
      [zimbra@zre-ldap005 ~]$ /opt/zimbra/common/bin/mysqld_safe --defaults-file=/opt/zimbra/conf/antispam-my.cnf --external-locking --malloc-lib=/opt/zimbra/common/lib/libtcmalloc_minimal.so --datadir=/opt/zimbra/data/amavisd/mysql/data --log-error=/opt/zimbra/log/antispam-mysqld.log --ledir=/opt/zimbra/common/sbin 151230 14:58:04 mysqld_safe Adding '/opt/zimbra/common/lib/libtcmalloc_minimal.so' to LD_PRELOAD for mysqld
      151230 14:58:04 mysqld_safe Logging to '/opt/zimbra/log/antispam-mysqld.log'.
      151230 14:58:04 mysqld_safe Starting mysqld daemon with databases from /opt/zimbra/data/amavisd/mysql/data

      Note that this is the exact basedir value provided in the cnf file:
      [zimbra@zre-ldap005 conf]$ grep basedir antispam-my.cnf
      basedir = /opt/zimbra/common

      It appears the issue is that the other mysql instance is running with the same basedir value:
      zimbra 2712 1 0 09:46 ? 00:00:00 /bin/sh /opt/zimbra/common/bin/mysqld_safe --defaults-file=/opt/zimbra/conf/my.cnf --external-locking --log-error=/opt/zimbra/log/mysql_error.log --malloc-lib=/opt/zimbra/common/lib/libtcmalloc_minimal.so --ledir=/opt/zimbra/common/sbin
      zimbra 2917 2712 0 09:46 ? 00:00:14 /opt/zimbra/common/sbin/mysqld --defaults-file=/opt/zimbra/conf/my.cnf --basedir=/opt/zimbra/common --datadir=/opt/zimbra/db/data --plugin-dir=/opt/zimbra/common/lib/plugin --external-locking --log-error=/opt/zimbra/log/mysql_error.log --pid-file=/opt/zimbra/log/mysql.pid --socket=/opt/zimbra/data/tmp/mysql/mysql.sock --port=7306

      However, there is nothing wrong with two instances of mysqld having the same value for basedir, as the entire point is for mysqld to be sharing the same binaries.

      Attachments

        Activity

          People

            Unassigned Unassigned
            quanah Quanah Gibson-Mount (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.