Bug 1241843 - CTDB:RHEL7: Yum remove/install ctdb gives error in pre_uninstall and post_install sections and fails to remove ctdb package
Summary: CTDB:RHEL7: Yum remove/install ctdb gives error in pre_uninstall and post_ins...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: samba
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: RHGS 3.1.0
Assignee: Jose A. Rivera
QA Contact: surabhi
URL:
Whiteboard:
Depends On:
Blocks: 1202842
TreeView+ depends on / blocked
 
Reported: 2015-07-10 08:35 UTC by surabhi
Modified: 2015-07-29 05:11 UTC (History)
6 users (show)

Fixed In Version: ctdb2.5-2.5.5-7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-29 05:11:21 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1495 0 normal SHIPPED_LIVE Important: Red Hat Gluster Storage 3.1 update 2015-07-29 08:26:26 UTC

Description surabhi 2015-07-10 08:35:41 UTC
Description of problem:
************************************
On RHEL7 when installing ctdb, I see errors in executing systemd_post.
When removing ctdb package, there are errors in executing systemd_preun.

On further analysis of ctdb.spec file for RHEL7 it is found that :

%preun
%if %{defined rhel} && %{rhel} < 7
if [ "$1" -eq "0" ] ; then
	/sbin/service ctdb stop > /dev/null 2>&1
	/sbin/chkconfig --del ctdb
fi
%else
systemd_preun ctdb.service
%endif

This section fails to execute as the systemd_preun is not found.

When checked in f17 : we see following lines:

 lines /usr/bin/systemctl --no-reload disable winbind.service > /dev/null 2>&1 || :     /usr/bin/systemctl stop winbind.service > /dev/null 2>&1 || :


Looks like on RHEL7 ctdb spec file, the command systemctl has to be used instead of systemd_preun. and systemd_post

refer to these links for further reference:

http://pkgs.fedoraproject.org/cgit/samba.git/tree/samba.spec?h=f17
http://pkgs.fedoraproject.org/cgit/samba.git/tree/samba.spec?h=f22

Errors are as follows:

***********************************************************************

  Installing : tdb-tools-1.3.4-1.el7rhgs.x86_64                                                                                                                     3/4 
  Installing : ctdb2.5-2.5.5-6.el7rhgs.x86_64                                                                                                                       4/4 
/var/tmp/rpm-tmp.Q0fPKz: line 1: systemd_post: command not found
warning: %post(ctdb2.5-2.5.5-6.el7rhgs.x86_64) scriptlet failed, exit status 127
Non-fatal POSTIN scriptlet failure in rpm package ctdb2.5-2.5.5-6.el7rhgs.x86_64

***************************************************************

While doing yum remove ctdb


*******************************************
Running transaction
/var/tmp/rpm-tmp.qWJJ3N: line 1: systemd_preun: command not found
error: %preun(ctdb2.5-2.5.5-6.el7rhgs.x86_64) scriptlet failed, exit status 127
Error in PREUN scriptlet in rpm package ctdb2.5-2.5.5-6.el7rhgs.x86_64
  Verifying  : ctdb2.5-2.5.5-6.el7rhgs.x86_64                                                                                                                       1/1 

*********************************************************


Version-Release number of selected component (if applicable):
ctdb2.5-2.5.5-6.el7rhgs.x86_64

How reproducible:
When try to install remove ctdb package on RHEL7.

Steps to Reproduce:
1. Install RHEL 7 ISO
2. Yum install ctdb package
3. Yum remove ctdb package

Actual results:
***********************************************************
Yum install gives error while installing ctdb.
Yum remove fails to remove ctdb package.

Expected results:
***********************************************************

Yum install ctdb and yum remove ctdb should be successfull without any errors.


Additional info:

Comment 2 Michael Adam 2015-07-10 10:58:05 UTC
I think we need to "Require(post|preun|postun): systemd".
Currently we only require systemd-units.

José, can you adapt this and do another build?

Comment 4 surabhi 2015-07-11 07:16:28 UTC
Another error I see is:

Running Transaction
  Installing : ctdb2.5-2.5.5-6.el6rhs.x86_64                                                                                                                       1/1 
libsemanage.dbase_llist_query: could not query record value (No such file or directory).

Comment 5 Jose A. Rivera 2015-07-11 14:41:01 UTC
This latest build updates the systemd requirements. It also fixes a pair of typos that caused the errors indicated in #C1.

Comment 6 surabhi 2015-07-13 10:12:08 UTC
Yum install ctdb and yum remove ctdb works fine with latest build ctdb2.5-2.5.5-7.

No errors seen while installing or removing ctdb package from RHEL7.1



Dependencies Resolved

========================================================================================================================================================================
 Package                            Arch                            Version                                   Repository                                           Size
========================================================================================================================================================================
Installing:
 ctdb2.5                            x86_64                          2.5.5-7.el7rhgs                           Server-RH-Gluster-3-Server                          512 k
Installing for dependencies:
 psmisc                             x86_64                          22.20-8.el7                               rhel-7-server-rpms                                  140 k
 tdb-tools                          x86_64                          1.3.4-1.el7rhgs                           Server-RH-Gluster-3-Server                           29 k

Transaction Summary
========================================================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 682 k
Installed size: 1.9 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): tdb-tools-1.3.4-1.el7rhgs.x86_64.rpm                                                                                                      |  29 kB  00:00:00     
(2/3): ctdb2.5-2.5.5-7.el7rhgs.x86_64.rpm                                                                                                        | 512 kB  00:00:00     
(3/3): psmisc-22.20-8.el7.x86_64.rpm                                                                                                             | 140 kB  00:00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   329 kB/s | 682 kB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : psmisc-22.20-8.el7.x86_64                                                                                                                            1/3 
  Installing : tdb-tools-1.3.4-1.el7rhgs.x86_64                                                                                                                     2/3 
  Installing : ctdb2.5-2.5.5-7.el7rhgs.x86_64                                                                                                                       3/3 
  Verifying  : tdb-tools-1.3.4-1.el7rhgs.x86_64                                                                                                                     1/3 
  Verifying  : psmisc-22.20-8.el7.x86_64                                                                                                                            2/3 
  Verifying  : ctdb2.5-2.5.5-7.el7rhgs.x86_64                                                                                                                       3/3 

Installed:
  ctdb2.5.x86_64 0:2.5.5-7.el7rhgs                                                                                                                                      

Dependency Installed:
  psmisc.x86_64 0:22.20-8.el7                                                     tdb-tools.x86_64 0:1.3.4-1.el7rhgs                                                    



yum remove ctdb
Loaded plugins: product-id, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package ctdb2.5.x86_64 0:2.5.5-7.el7rhgs will be erased
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                          Arch                            Version                                    Repository                                            Size
========================================================================================================================================================================
Removing:
 ctdb2.5                          x86_64                          2.5.5-7.el7rhgs                            @Server-RH-Gluster-3-Server                          1.3 M

Transaction Summary
========================================================================================================================================================================
Remove  1 Package

Installed size: 1.3 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : ctdb2.5-2.5.5-7.el7rhgs.x86_64                    



Marking the BZ to verified.

Comment 7 errata-xmlrpc 2015-07-29 05:11:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1495.html


Note You need to log in before you can comment on or make changes to this bug.