[MDEV-19706] RPM no longer installs init script on systemd systems, but preun script still tries to erase it Created: 2019-06-06  Updated: 2020-08-25  Resolved: 2019-06-11

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform RedHat, Scripts & Clients
Affects Version/s: 10.4.5
Fix Version/s: 10.4.6

Type: Bug Priority: Critical
Reporter: Geoff Montee (Inactive) Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-10797 RPM includes init script and a system... Closed
Relates
relates to MDEV-11046 systemd loses control of running daem... Closed
relates to MDEV-15526 SysV init service deployed file '/etc... Closed

 Description   

After the fix for MDEV-10797, RPMs no longer install the init script on systems that use systemd. However, the RPM preun script still tries to erase the init script. See here:

https://github.com/MariaDB/server/blob/mariadb-10.4.5/support-files/rpm/server-preun.sh#L12

This leads to the following problem:

$ rpm -e MariaDB-server
error: %preun(MariaDB-server-10.4.5-1.el7.centos.x86_64) scriptlet failed, exit status 1
error: MariaDB-server-10.4.5-1.el7.centos.x86_64: erase failed

More verbose output shows:

+ '[' -x /sbin/chkconfig ']'
+ /sbin/chkconfig --del mysql
D: %preun(MariaDB-server-10.4.5-1.el7.centos.x86_64): waitpid(3107) rc 3107 status 100
error: %preun(MariaDB-server-10.4.5-1.el7.centos.x86_64) scriptlet failed, exit status 1
error: MariaDB-server-10.4.5-1.el7.centos.x86_64: erase failed



 Comments   
Comment by Juan [ 2019-06-06 ]

Currently you can work around the error by suppressing the problem script:

rpm -e --noscripts MariaDB-server

Comment by Sergei Golubchik [ 2019-06-07 ]

Because chkconfig is

a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories

I'll change to run it only if /etc/init.d/mysql exists

Generated at Thu Feb 08 08:53:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.