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

Setting RPM caps on mariadbd instead of mysqld creates permission errors and failing RPM installs

    XMLWordPrintable

Details

    Description

      https://github.com/MariaDB/server/commits/7027690f0aff591b2e5989c80c8b2ba7ef0b9a10

      IF (CMAKE_VERSION VERSION_GREATER 3.10.0)
        # cmake bug #14362
        SET(CPACK_RPM_server_USER_FILELIST ${CPACK_RPM_server_USER_FILELIST}
            "%caps(cap_ipc_lock=pe) %{_sbindir}/mysqld"
            "%caps(cap_ipc_lock=pe) %{_sbindir}/mariadbd"
            )
      ENDIF()
      

      The above commit breaks the installation of the MariaDB-server-10.5 RPM and mariadb-install-db as experienced in a docker container on fedora:38 and can be recreated as follows.

      yum install -y yum-utils rpm-build openssl-devel graphviz git
      yum-builddep -y mariadb-server
      mkdir builddir; cd builddir
      export CI_JOB_NAME=failing-fedora-install;
      export CMAKE_FLAGS='-DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF'
      cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS ..
      make package -j 32
      yum install -y *.rpm
      

      Installing       : MariaDB-server-10.5.25-1.fc38.x86_64                                                                                                                        5/25
        Running scriptlet: MariaDB-server-10.5.25-1.fc38.x86_64                                                                                                                        5/25
      /usr/bin/mariadb-install-db: line 563: /usr/sbin/mysqld: Operation not permitted
       
      Installation of system tables failed!  Examine the logs in
      /var/lib/mysql for more information.
       
      The problem could be conflicting information in an external
      my.cnf files. You can ignore these by doing:
       
          shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
       
      You can also try to start the mariadbd daemon with:
       
          shell> /usr/sbin/mysqld --skip-grant-tables --general-log &
       
      and use the command line tool /usr/bin/mariadb
      to connect to the mysql database and look at the grant tables:
       
          shell> /usr/bin/mariadb -u root mysql
          MariaDB> show tables;
       
      Try '/usr/sbin/mysqld --help' if you have problems with paths.  Using
      --general-log gives you a log in /var/lib/mysql that may be helpful.
       
      The latest information about mysql_install_db is available at
      https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
      You can find the latest source at https://downloads.mariadb.org and
      the maria-discuss email list at https://launchpad.net/~maria-discuss
       
      Please check all of the above before submitting a bug report
      at https://mariadb.org/jira
       
      chmod: cannot access '/var/lib/mysql/mysql': No such file or directory
      

      Line 563 of mariadb-install-db:

      # Configure mysqld command line
      mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
      mysqld_install_cmd_line()
      {
        "$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup\
        "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" \
        "--plugin-dir=${plugindir}" \
        $args --max_allowed_packet=8M \
        --net_buffer_length=16K
      }
      

      dropping this commit and then re-running the above commands fixes the error

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              anson Anson
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.