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

RPM includes init script and a systemd unit

Details

    • 10.1.30

    Description

      MariaDB 10.1.17 and other recent releases still include an init script as well as a systemd unit. The init script ships with chkconfig on and this causes a race condition as to which version of the daemon starts first. This has caused us significant problems with RPM updates and system reboots.

      [jg4461@db2 ~]$ yum provides */init.d/mysql
      MariaDB-server-10.1.16-1.el7.centos.x86_64 : MariaDB: a very fast and robust SQL database server
      Repo        : mariadb-enterprise-main
      Matched from:
      Filename    : /etc/init.d/mysql
       
      MariaDB-server-10.1.17-1.el7.centos.x86_64 : MariaDB: a very fast and robust SQL database server
      Repo        : mariadb
      Matched from:
      Filename    : /etc/init.d/mysql
      

      Attachments

        Issue Links

          Activity

            svoj what about fixing pre/post scriptlets first? Then packagers will be able to exclude mysql.init script at their discretion. And in our packages we could, perhaps, move it to @sharedir@ (on systemd based distributions) instead of deleting it completely.

            serg Sergei Golubchik added a comment - svoj what about fixing pre/post scriptlets first? Then packagers will be able to exclude mysql.init script at their discretion. And in our packages we could, perhaps, move it to @sharedir@ (on systemd based distributions) instead of deleting it completely.

            serg, that should work as well. I just thought that fixing race condition might be simpler and safer for 10.1.

            svoj Sergey Vojtovich added a comment - serg , that should work as well. I just thought that fixing race condition might be simpler and safer for 10.1.
            danblack Daniel Black added a comment -

            PR #593 submitted to reflect this design.

            danblack Daniel Black added a comment - PR #593 submitted to reflect this design.

            Version 10.2 is affected :

            /etc/cron.daily/0yum-daily.cron:

            Shutting down MariaDB..[ OK ]
            Starting MariaDB.180215 09:22:26 mysqld_safe Logging to '/var/log/mysql/mysqld.log'.
            180215 09:22:26 mysqld_safe Starting mysqld daemon with databases from /data/mysql .[ OK ]
            Warning: mysqld.service changed on disk. Run 'systemctl daemon-reload' to reload units.
            Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
            The following updates will be applied on srvmysql-dev.aaa.ccfa:
            ================================================================================
            Package Architecture
            Version Dépôt Taille
            ================================================================================
            Mise à jour :
            MariaDB-client x86_64 10.2.13-1.el7.centos mariadb102 48 M
            MariaDB-common x86_64 10.2.13-1.el7.centos mariadb102 155 k
            MariaDB-compat x86_64 10.2.13-1.el7.centos mariadb102 2.8 M
            MariaDB-server x86_64 10.2.13-1.el7.centos mariadb102 110 M
            MariaDB-shared x86_64 10.2.13-1.el7.centos mariadb102 394 k

            Résumé de la transaction
            ================================================================================
            Mettre à jour 5 Paquets
            The updates were successfully applied

            ------------
            2 symbolics link are created in the rpm package :
            ln -s /usr/lib/systemd/system/mariadb.service /etc/systemd/system/mysql.service
            ln -s /usr/lib/systemd/system/mariadb.service /etc/systemd/system/mysqld.service

            But the init script has priority over the systemd script...

            One of the solutions when updating packages is creating a postaction script in yum, this is bad but it's work ...

            cat /etc/yum/post-actions/mysql.action
            #!/bin/sh

            MariaDB*:update:/usr/bin/systemctl daemon-reload && for i in `/usr/bin/ps auxf|/usr/bin/grep mysqld|/usr/bin/grep "grep" -v|/usr/bin/awk '

            {print $2}

            '`; do /usr/bin/kill -9 $i; done && rm -f /etc/init.d/mysql && /usr/bin/systemctl restart mysql

            wywerne Philippe PETIT added a comment - Version 10.2 is affected : /etc/cron.daily/0yum-daily.cron: Shutting down MariaDB..[ OK ] Starting MariaDB.180215 09:22:26 mysqld_safe Logging to '/var/log/mysql/mysqld.log'. 180215 09:22:26 mysqld_safe Starting mysqld daemon with databases from /data/mysql .[ OK ] Warning: mysqld.service changed on disk. Run 'systemctl daemon-reload' to reload units. Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details. The following updates will be applied on srvmysql-dev.aaa.ccfa: ================================================================================ Package Architecture Version Dépôt Taille ================================================================================ Mise à jour : MariaDB-client x86_64 10.2.13-1.el7.centos mariadb102 48 M MariaDB-common x86_64 10.2.13-1.el7.centos mariadb102 155 k MariaDB-compat x86_64 10.2.13-1.el7.centos mariadb102 2.8 M MariaDB-server x86_64 10.2.13-1.el7.centos mariadb102 110 M MariaDB-shared x86_64 10.2.13-1.el7.centos mariadb102 394 k Résumé de la transaction ================================================================================ Mettre à jour 5 Paquets The updates were successfully applied ------------ 2 symbolics link are created in the rpm package : ln -s /usr/lib/systemd/system/mariadb.service /etc/systemd/system/mysql.service ln -s /usr/lib/systemd/system/mariadb.service /etc/systemd/system/mysqld.service But the init script has priority over the systemd script... One of the solutions when updating packages is creating a postaction script in yum, this is bad but it's work ... cat /etc/yum/post-actions/mysql.action #!/bin/sh MariaDB*:update:/usr/bin/systemctl daemon-reload && for i in `/usr/bin/ps auxf|/usr/bin/grep mysqld|/usr/bin/grep "grep" -v|/usr/bin/awk ' {print $2} '`; do /usr/bin/kill -9 $i; done && rm -f /etc/init.d/mysql && /usr/bin/systemctl restart mysql

            Overdue PR.

            svoj Sergey Vojtovich added a comment - Overdue PR.

            People

              serg Sergei Golubchik
              jgazeley Jonathan Gazeley
              Votes:
              3 Vote for this issue
              Watchers:
              12 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.