Bug 807028 - The update of rhn-virtualization-host affecting autostart of the service.
The update of rhn-virtualization-host affecting autostart of the service.
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
1.8
noarch Linux
medium Severity high
: ---
: ---
Assigned To: Stephen Herr
Red Hat Satellite QA List
: Patch
Depends On: 646284
Blocks: space18
  Show dependency treegraph
 
Reported: 2012-03-26 15:32 EDT by Stephen Herr
Modified: 2012-11-01 12:21 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 646284
Environment:
Last Closed: 2012-11-01 12:21:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Herr 2012-03-26 15:32:48 EDT
+++ This bug was initially created as a clone of Bug #646284 +++

Description of problem:
When rhn-virtualization-host package is updated, the links of the service script under /etc/rc.d/rcX.d are deleted.


Version-Release number of selected component (if applicable):

  * rhn-virtualization-host (All released version)

How reproducible:

1. Check package's version.
  (e.g. update from 5.3.0-14.el5sat to 5.3.0-18.el5sat.)
  # rpm -q rhn-virtualization-host
  rhn-virtualization-host-5.3.0-14.el5sat

2. Check the registration of service script.
  # chkconfig --list | grep rhn-virtualization-host
  rhn-virtualization-host	0:off	1:off	2:on	3:on	4:on	5:on	6:off

3. Update package.
  # yum update -y rhn-virtualization-host
  # rpm -q rhn-virtualization-host
  rhn-virtualization-host-5.3.0-18.el5sat
  
  
Actual results:
  # chkconfig --list | grep rhn-virtualization-host
  (no outputs)

Expected results:
  # chkconfig --list | grep rhn-virtualization-host
  rhn-virtualization-host	0:off	1:off	2:on	3:on	4:on	5:on	6:off


Additional info:

A cause was found in the installation script of the rhn-virtualization-host.

  # rpm -q rhn-virtualization-host --scripts
  postinstall scriptlet (using /bin/sh):
  /sbin/chkconfig --add rhn-virtualization-host
  /sbin/service crond condrestart
  preuninstall scriptlet (using /bin/sh):
  /sbin/chkconfig --del rhn-virtualization-host
  postuninstall scriptlet (using /bin/sh):
  /sbin/service crond condrestart

The above script has not been considered for the state registration of a service script under /etc/rc.d/rcX.d/.

Possible fix:
----------------------------------------------------------------------
@@ -85,7 +85,9 @@
 /sbin/service crond condrestart
 
 %preun host
-/sbin/chkconfig --del rhn-virtualization-host
+if [ $1 = 0 ]; then
+  /sbin/chkconfig --del rhn-virtualization-host
+fi
 
 %postun host
 /sbin/service crond condrestart
----------------------------------------------------------------------

Even if we release a new package which includes the above patch, updating to the package doesn't work as expected because the updating uses preun section in old package. Thus, we need to update twice to get an expected result.

Updating from old package to new package(but old preun section is used):
----------------------------------------------------------------------
[root@yzsv58 ~]# rpm -q rhn-virtualization-host
rhn-virtualization-host-5.4.14-8.el5sat
[root@yzsv58 ~]# chkconfig --list | grep rhn-virtualization-hostrhn-virtualization-host 0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@yzsv58 ~]# rpm -Uhv rhn-virtualization-host-5.4.14-9.bz646284.el5.noarch.rpm rhn-virtualization-common-5.4.14-9.bz646284.el5.noarch.rpm 
準備中...                ########################################### [100%]
   1:rhn-virtualization-comm########################################### [ 50%]
   2:rhn-virtualization-host########################################### [100%]
crond を停止中: [  OK  ]
crond を起動中: [  OK  ]
crond を停止中: [  OK  ]
crond を起動中: [  OK  ]
[root@yzsv58 ~]# chkconfig --list | grep rhn-virtualization-host
[root@yzsv58 ~]# 
----------------------------------------------------------------------

Updating from new package to 2nd new package(preun section in 1st new package is used):
----------------------------------------------------------------------
[root@yzsv58 ~]# rpm -q rhn-virtualization-hostrhn-virtualization-host-5.4.14-9.bz646284.el5
[root@yzsv58 ~]# chkconfig --list | grep rhn-virtualization-hostrhn-virtualization-host 0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@yzsv58 ~]# rpm -Uhv rhn-virtualization-host-5.4.14-10.bz646284.el5.noarch.rpm rhn-virtualization-common-5.4.14-10.bz646284.el5.noarch.rpm 
準備中...                ########################################### [100%]
   1:rhn-virtualization-comm########################################### [ 50%]
   2:rhn-virtualization-host########################################### [100%]
crond を停止中: [  OK  ]
crond を起動中: [  OK  ]
crond を停止中: [  OK  ]
crond を起動中: [  OK  ]
[root@yzsv58 ~]# chkconfig --list | grep rhn-virtualization-host
rhn-virtualization-host 0:off   1:off   2:on    3:on    4:on    5:on    6:off
----------------------------------------------------------------------

It looks confusable, so if you have any questions please let me know.

Regards,
M Yamazaki
Comment 3 Stephen Herr 2012-03-27 09:41:44 EDT
Patch verified and committed to spacewalk master as d63319a9e891d191d9520f1ed310197664847d7f

Note that Masayoshi says, this will take two updates for the customer will see the improved behaviour. The first update will be affected by the bug in the previous version but will fix the problem so that the next update will not be affected by the bug.
Comment 4 Jan Pazdziora 2012-10-30 15:25:54 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 5 Jan Pazdziora 2012-11-01 12:21:45 EDT
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

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