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

mysqld_safe may incorrectly detect basedir when started as script

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1.28, 10.2.10
    • 10.4
    • Scripts & Clients
    • None

    Description

      I want to debug mysqld_safe and start it as:

      bash -x -v mysqld_safe
      

      This typically results in error like below:

      2017-10-01 22:07:53 139934377842944 [Note] //sbin/mysqld (mysqld 10.1.28-MariaDB) starting as process 273 ...
      2017-10-01 22:07:53 139934377842944 [ERROR] Can't find messagefile '/share/mysql/errmsg.sys'
      2017-10-01 22:07:53 139934377842944 [ERROR] Aborting
      

      Suggested fix which works with bash , needs to be verified on other platforms:

      $ diff /usr/bin/mysqld_safe.old /usr/bin/mysqld_safe 
      520a521,526
      > if [ "$(uname)" == Linux ] && [ -n "$BASH_SOURCE" ] ; then 
      >   MY_PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
      > else
      >   MY_PWD=`dirname $0`
      >   MY_PWD=`cd "$MY_PWD"/.. && pwd`
      > fi
      522,523d527
      < MY_PWD=`dirname $0`
      < MY_PWD=`cd "$MY_PWD"/.. && pwd`
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              anikitin Andrii Nikitin (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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