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

[PATCH] mysqld_multi default log location in wrong directory

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.0.13
    • 10.5, 10.6, 10.11
    • None
    • Linux (but should not be OS specific)

    Description

      From my original bug report http://bugs.mysql.com/73750

      Description:
      If no datadir is set via option files or command line the log location defaults to:

        [...]
        if (!defined($logdir))
        {
          $logdir= "/usr/share/mysql" if (-d "/usr/share/mysql" && -w "/usr/share/mysql");
        }
        [...]

      (or whatever the "share" path is for the current installation) in the init_log() function inside the script

      This is a very unexpected location, and AFAICT in violation with the linux file system standard (and Unix practice in general) as /usr should be considered read-only for everything but software installation actions (so that a read-only /usr file system can be shared between multiple installations)

      How to repeat:
      Check source of installed mysqld_multi script or just use mysqld_multi with --no-defaults or the exampe my.cnf given in the script itself, then see that you have a "mysqld_multi.log" file in the same directory that the error message translations, charset information, and files like mysql_system_tables.sql are in
      (usually /usr/share/mysql or /usr/local/mysql/share ...) ... at least if the user executing mysqld_multi had sufficient permissions to write there ...

      Suggested fix:
      The default log location should be the default datadir, not pkgdatadir ...

      Attachments

        Activity

          hholzgra Hartmut Holzgraefe created issue -
          hholzgra Hartmut Holzgraefe added a comment - - edited

          Suggested fix:

          === modified file 'scripts/mysqld_multi.sh'
          --- scripts/mysqld_multi.sh	2014-08-03 15:13:56 +0000
          +++ scripts/mysqld_multi.sh	2014-08-28 08:59:17 +0000
          @@ -246,7 +246,7 @@
             }
             if (!defined($logdir))
             {
           -    $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@");
           +    $logdir= "@localstatedir@" if (-d "@localstatedir@" && -w "@localstatedir@");
             }
             if (!defined($logdir))
             {

          hholzgra Hartmut Holzgraefe added a comment - - edited Suggested fix: === modified file 'scripts/mysqld_multi.sh' --- scripts/mysqld_multi.sh 2014-08-03 15:13:56 +0000 +++ scripts/mysqld_multi.sh 2014-08-28 08:59:17 +0000 @@ -246,7 +246,7 @@ } if (!defined($logdir)) { - $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@"); + $logdir= "@localstatedir@" if (-d "@localstatedir@" && -w "@localstatedir@"); } if (!defined($logdir)) {
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Description From my original bug report http://bugs.mysql.com/73750

          Description:
          If no datadir is set via option files or command line the log location defaults to:

            [...]
            if (!defined($logdir))
            {
              $logdir= "/usr/share/mysql" if (-d "/usr/share/mysql" && -w "/usr/share/mysql");
            }
            [...]

          (or whatever the "share" path is for the current installation) in the init_log() function inside the script

          This is a very unexpected location, and AFAICT in violation with the linux file system standard (and Unix practice in general) as /usr should be considered read-only for everything but software installation actions (so that a read-only /usr file system can be shared between multiple installations)

          How to repeat:
          Check source of installed mysqld_multi script or just use mysqld_multi with --no-defaults or the exampe my.cnf given in the script itself, then see that you have a "mysqld_multi.log" file in the same directory that the error message translations, charset information, and files like mysql_system_tables.sql are in
          (usually /usr/share/mysql or /usr/local/mysql/share ...) ... at least if the user executing mysqld_multi had sufficient permissions to write there ...

          Suggested fix:
          The default log location should be the default datadir, not pkgdatadir ...
          From my original bug report http://bugs.mysql.com/73750

          Description:
          If no datadir is set via option files or command line the log location defaults to:

          {noformat}
            [...]
            if (!defined($logdir))
            {
              $logdir= "/usr/share/mysql" if (-d "/usr/share/mysql" && -w "/usr/share/mysql");
            }
            [...]
          {noformat}

          (or whatever the "share" path is for the current installation) in the init_log() function inside the script

          This is a very unexpected location, and AFAICT in violation with the linux file system standard (and Unix practice in general) as /usr should be considered read-only for everything but software installation actions (so that a read-only /usr file system can be shared between multiple installations)

          How to repeat:
          Check source of installed mysqld_multi script or just use mysqld_multi with --no-defaults or the exampe my.cnf given in the script itself, then see that you have a "mysqld_multi.log" file in the same directory that the error message translations, charset information, and files like mysql_system_tables.sql are in
          (usually /usr/share/mysql or /usr/local/mysql/share ...) ... at least if the user executing mysqld_multi had sufficient permissions to write there ...

          Suggested fix:
          The default log location should be the default datadir, not pkgdatadir ...
          elenst Elena Stepanova made changes -
          Labels upstream
          Summary mysqld_multi default log location in wrong directory [PATCH] mysqld_multi default log location in wrong directory
          elenst Elena Stepanova made changes -
          serg Sergei Golubchik made changes -
          Due Date 2014-11-04
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0 [ 16000 ]
          serg Sergei Golubchik made changes -
          Due Date 2014-11-04
          serg Sergei Golubchik made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          elenst Elena Stepanova made changes -
          Labels upstream patch upstream
          serg Sergei Golubchik made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 53304 ] MariaDB v3 [ 65734 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 65734 ] MariaDB v4 [ 139688 ]
          TheLinuxJedi Andrew Hutchings (Inactive) made changes -
          Assignee Andrew Hutchings [ JIRAUSER52179 ]

          Added a couple of comments on the PR, once these are solved we can look at merging it.

          TheLinuxJedi Andrew Hutchings (Inactive) added a comment - Added a couple of comments on the PR, once these are solved we can look at merging it.
          TheLinuxJedi Andrew Hutchings (Inactive) made changes -
          Assignee Andrew Hutchings [ JIRAUSER52179 ] Hartmut Holzgraefe [ hholzgra ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0 [ 16000 ]
          serg Sergei Golubchik made changes -
          Assignee Hartmut Holzgraefe [ hholzgra ] Andrew Hutchings [ JIRAUSER52179 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.7 [ 24805 ]
          Fix Version/s 10.8 [ 26121 ]
          Fix Version/s 10.9 [ 26905 ]
          Fix Version/s 10.10 [ 27530 ]
          Fix Version/s 10.11 [ 27614 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.7 [ 24805 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.3 [ 22126 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.8 [ 26121 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.9 [ 26905 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.10 [ 27530 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.4 [ 22408 ]
          danblack Daniel Black made changes -
          Assignee Andrew Hutchings [ JIRAUSER52179 ]

          People

            Unassigned Unassigned
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.