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

RPM should execute systemctl daemon-reload after update

Details

    • 10.1.30

    Description

      The RPM for RHEL7 (and other distros that use systemd) should execute systemctl daemon-reload after updating the RPM, to prevent this error message:

      Warning: mariadb.service changed on disk. Run 'systemctl daemon-reload' to reload units.

      This should occur in the %post-install section, otherwise changes to the systemd unit will not get picked up until a manual intervention is made.

      Not sure if related, but after updating the RPM, systemd seems to lose control of the running daemon, but I'll log this as a separate issue.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment - - edited

            https://src.fedoraproject.org/rpms/mariadb/blob/master/f/mariadb.spec#_1212

            "%systemd_post %{daemon_name}.service"
            

            Unsure of portability.

            danblack Daniel Black added a comment - - edited https://src.fedoraproject.org/rpms/mariadb/blob/master/f/mariadb.spec#_1212 "%systemd_post %{daemon_name}.service" Unsure of portability.
            danblack Daniel Black added a comment -

            Looks like this was added in MDEV-7368 - https://github.com/MariaDB/server/commit/919825a3ad5e#diff-30e05864e6af52293e9ee90a053bb658, Could it be possible systemctl isn't in /usr/bin on Centos?

            The %systemd_post macro is quite different using presets however https://github.com/systemd/systemd/blob/master/src/core/macros.systemd.in#L51..L56

            danblack Daniel Black added a comment - Looks like this was added in MDEV-7368 - https://github.com/MariaDB/server/commit/919825a3ad5e#diff-30e05864e6af52293e9ee90a053bb658 , Could it be possible systemctl isn't in /usr/bin on Centos? The %systemd_post macro is quite different using presets however https://github.com/systemd/systemd/blob/master/src/core/macros.systemd.in#L51..L56

            Can confirm that systemctl is in /usr/bin on CentOS 7

            [jonathan@zeus ~]$ which systemctl
            /usr/bin/systemctl
            [jonathan@zeus ~]$ uname -r
            3.10.0-693.11.6.el7.x86_64
            

            jgazeley Jonathan Gazeley added a comment - Can confirm that systemctl is in /usr/bin on CentOS 7 [jonathan@zeus ~]$ which systemctl /usr/bin/systemctl [jonathan@zeus ~]$ uname -r 3.10.0-693.11.6.el7.x86_64
            danblack Daniel Black added a comment -

            Thanks jgazeley, created https://github.com/MariaDB/server/pull/592 to fix this though I suspect the main factor, daemon-reload required, was fixed in systemd rpm macros while back. If this is wrong I'm happy to be corrected however I didn't see any special handling of daemon-reload in the fedora spec https://src.fedoraproject.org/rpms/mariadb/blob/master/f/mariadb.spec on which I based a lot of these changes.

            This might address some of the most annoying aspects of MDEV-10797 too even though it hasn't actually removed the init script.

            Feedback welcome.

            danblack Daniel Black added a comment - Thanks jgazeley , created https://github.com/MariaDB/server/pull/592 to fix this though I suspect the main factor, daemon-reload required, was fixed in systemd rpm macros while back. If this is wrong I'm happy to be corrected however I didn't see any special handling of daemon-reload in the fedora spec https://src.fedoraproject.org/rpms/mariadb/blob/master/f/mariadb.spec on which I based a lot of these changes. This might address some of the most annoying aspects of MDEV-10797 too even though it hasn't actually removed the init script. Feedback welcome.

            Overdue PR.

            svoj Sergey Vojtovich added a comment - Overdue PR.

            as far as I can see, post-install scriptlet was running systemctl daemon-reload since 2015. Is it not enough?

            serg Sergei Golubchik added a comment - as far as I can see, post-install scriptlet was running systemctl daemon-reload since 2015. Is it not enough?

            People

              serg Sergei Golubchik
              jgazeley Jonathan Gazeley
              Votes:
              0 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.