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

mysql_install_db shouldn't execute chown

Details

    Description

      One of the fixes for MDEV-19876 added a "chown" call to mysql_install_db:

      https://github.com/mariadb/server/commit/ec494cb1fadb40ae25b944bb1229fc2d6f88e8c6

      This essentially introduces a new limitation that mysql_install_db has to be run as root. This is not ideal for all users.

      The "chown" call didn't actually fix MDEV-19876, so maybe we should remove it. The proper fix for MDEV-19876 required changing the RPM's post-installation script:

      https://github.com/mariadb/server/commit/11f3e2366282eb8cf1cb0062793d102067db6472

      In my opinion, a packaging script seems like a more appropriate place for a fix like this than mysql_install_db does.

      Attachments

        Issue Links

          Activity

            sanja Oleksandr Byelkin added a comment - - edited

            What about people who do not use packaging scripts? (uses tarball instead of rpm or deb)

            sanja Oleksandr Byelkin added a comment - - edited What about people who do not use packaging scripts? (uses tarball instead of rpm or deb)

            People who use binary tarballs are the ones who are most likely to run mysql_install_db is a non-root user, so those are the users who are most likely to encounter this issue.

            If you want to keep this behavior in mysql_install_db, then I would suggest making it optional, and requiring an option to enable it. What could the option be called? -chown, chown-pamtool, -root?

            e.g.:

            mysql_install_db --user=mysql --chown-pamtool
            

            GeoffMontee Geoff Montee (Inactive) added a comment - People who use binary tarballs are the ones who are most likely to run mysql_install_db is a non-root user, so those are the users who are most likely to encounter this issue. If you want to keep this behavior in mysql_install_db , then I would suggest making it optional, and requiring an option to enable it. What could the option be called? - chown , chown-pamtool , -root ? e.g.: mysql_install_db --user=mysql --chown-pamtool

            How it should lead to install failure if it should print an error and proceed?

            sanja Oleksandr Byelkin added a comment - How it should lead to install failure if it should print an error and proceed?

            In my opinion, the error should probably be non-fatal, so it should just print an error message and continue. A failed chown should be easy for a user to fix manually.

            GeoffMontee Geoff Montee (Inactive) added a comment - In my opinion, the error should probably be non-fatal, so it should just print an error message and continue. A failed chown should be easy for a user to fix manually.

            People

              serg Sergei Golubchik
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              8 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.