[MDEV-11045] RPM should execute systemctl daemon-reload after update Created: 2016-10-13  Updated: 2019-05-13  Resolved: 2019-05-13

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform RedHat
Affects Version/s: 10.1.17, 10.1.18
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Jonathan Gazeley Assignee: Sergei Golubchik
Resolution: Incomplete Votes: 0
Labels: contribution, foundation, init, need_feedback, packaging, patch, systemd
Environment:

CentOS 7


Issue Links:
Blocks
blocks MDEV-10797 RPM includes init script and a system... Closed
Relates
relates to MDEV-11046 systemd loses control of running daem... Closed
Sprint: 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.



 Comments   
Comment by Daniel Black [ 2017-12-18 ]

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

"%systemd_post %{daemon_name}.service"

Unsure of portability.

Comment by Daniel Black [ 2018-02-03 ]

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

Comment by Jonathan Gazeley [ 2018-02-03 ]

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

Comment by Daniel Black [ 2018-02-04 ]

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.

Comment by Sergey Vojtovich [ 2018-03-13 ]

Overdue PR.

Comment by Sergei Golubchik [ 2019-03-22 ]

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

Generated at Thu Feb 08 07:46:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.