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

RPM Posttrans syntax error

    XMLWordPrintable

Details

    Description

      MariaDB-Server POSTTRANS script in 10.5.10 RPMs (both CentOS/RHEL and SLES) causes a shell error on upgrade from earlier versions. This does not prevent the package update from completing, but due to the failed check the intended systemctl restart of the service is not happening ...

      E.g. on CentOS/8 with yum, when using "yum update" to upgrade from 10.5.9 to 10.5.10, this is reported as:

      [...]
        Cleanup          : galera-4-26.4.7-1.el8.x86_64                                                                                          10/10 
        Running scriptlet: MariaDB-server-10.5.10-1.el8.x86_64                                                                                   10/10 
      /var/tmp/rpm-tmp.Tk0Qos: line 6: [: is-active: binary operator expected
       
        Running scriptlet: galera-4-26.4.7-1.el8.x86_64                                                                                          10/10 
      [...]
      

      [...]
      (4/4) Installing: MariaDB-server-10.5.10-1.x86_64 ................................................[done]
      Executing %posttrans script 'MariaDB-server-10.5.10-1.x86_64.rpm' -----------------------------------[\]
      Output of MariaDB-server-10.5.10-1.x86_64.rpm %posttrans script:
          /var/adm/update-scripts/posttransLZaa4D/MariaDB-server-10.5.10-1.x86_64.rpmxiouMA: line 7: [: is-active: binary operator expected
       
      Executing %posttrans scripts .....................................................................[done]
      [...]
      

      Suggested fix:

      --- old/POSTTRANS	2021-06-15 15:35:02.209791910 +0200
      +++ new/POSTTRANS	2021-06-15 15:35:42.137511570 +0200
      @@ -3,7 +3,7 @@
         # only restart the server if it was already running
         if [ -x /usr/bin/systemctl ] ; then
           /usr/bin/systemctl daemon-reload > /dev/null 2>&1
      -    if [ /usr/bin/systemctl is-active mysql ]; then
      +    if /usr/bin/systemctl is-active mysql ; then
             /usr/bin/systemctl restart mysql > /dev/null 2>&1
           else
             /usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1
      

      Attachments

        Activity

          People

            abychko Alexey Bychko (Inactive)
            hholzgra Hartmut Holzgraefe
            Votes:
            1 Vote for this issue
            Watchers:
            5 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.