Bug 533283 - rhn-virtualization-host RPM should not restart the service in %post
Summary: rhn-virtualization-host RPM should not restart the service in %post
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Virtualization
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Petr Sklenar
URL:
Whiteboard:
Depends On:
Blocks: sat531-blockers 533951 545222 556823
TreeView+ depends on / blocked
 
Reported: 2009-11-05 21:34 UTC by Alan Pevec
Modified: 2016-04-26 17:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-10 11:13:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (742 bytes, patch)
2009-11-05 21:56 UTC, Alan Pevec
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1660 0 normal SHIPPED_LIVE rhn-virtualization bug fix update 2009-12-10 11:13:37 UTC

Description Alan Pevec 2009-11-05 21:34:16 UTC
Description of problem:
When LiveCD image is created with rhn-virtualization-host in the package list, crond is started in %post which keeps the image busy and finally ends up in the corrupted image.

I think this would also be a problem with anaconda kickstart installations, quoting Fedora packaging guidelines:
https://fedoraproject.org/wiki/Packaging/SysVInitScript#InitscriptScriptlets
>  Why don't we....
>   * start the service after installation? 
> Installations can be in changeroots, in an installer context,
> or in other situations where you don't want the services started.

Here is relevant part of the spec file:
%post host
/sbin/chkconfig --add rhn-virtualization-host
/sbin/service crond restart

%preun host
/sbin/chkconfig --del rhn-virtualization-host

%postun host
/sbin/service crond restart

It should be, at least, changed to condrestart,
so that crond is not started if it wasn't running before.
Also, to be completely correct, scriptlets requirements should be listed explicitly:  Requires(pre): /usr/bin/crond

Version-Release number of selected component (if applicable):
rhn-virtualization-5.3.0-13.el5sat

How reproducible:
Try creating LiveCD with rhn-virtualization-host included in the pacakge list

Comment 1 Alan Pevec 2009-11-05 21:56:39 UTC
Created attachment 367738 [details]
proposed patch

Comment 3 Milan Zázrivec 2009-12-07 18:43:15 UTC
Took suggestion from comment #1

spacewalk.git master: 017825145e740cf95d12304ee155ac567781edb3
satellite.git SATELLITE-5.3: 4fdb63cf9b4ab1628a408e88f2245113f31003e8

Comment 5 Alan Pevec 2009-12-08 11:11:53 UTC
With rhn-virtualization-host-5.3.0-14.el5sat.noarch livecd image is created without errors.

Comment 6 Petr Sklenar 2009-12-09 17:26:54 UTC
testing procedure:
1. crond is stopped
2. add virtualization entitlement to kvm-host
3. rhn_check -vv
4. crond is stopped

[root@dhcp-lab-146 ~]# service crond status
crond is stopped
[root@dhcp-lab-146 ~]# rhn_check -vv
D: check_action {'action': "<?xml version='1.0'?>\n<methodCall>\n<methodName>packages.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><array><data>\n<value><string>rhn-virtualization-host</string></value>\n<value><string>5.3.0</string></value>\n<value><string>14.el5sat</string></value>\n<value><string></string></value>\n<value><string>noarch</string></value>\n</data></array></value>\n</data></array></value>\n</param>\n</params>\n</methodCall>\n", 'version': 2, 'id': 1485}
updateLoginInfo() login info
D: login(forceUpdate=True) invoked
logging into up2date server
D: writeCachedLogin() invoked
D: Wrote pickled loginInfo at  1260388287.14  with expiration of  1260391887.14  seconds.
successfully retrieved authentication token from up2date server
D: logininfo: {'X-RHN-Server-Id': 1000010426, 'X-RHN-Auth-Server-Time': '1260379350.44', 'X-RHN-Auth': 'VSOIA4XfAXvDZWu/ctMytw==', 'X-RHN-Auth-Channels': [['rhel-x86_64-server-5', '20091112171053', '1', '1'], ['rhel-x86_64-server-vt-5', '20091112171053', '0', '1'], ['rhn-tools-rhel-x86_64-server-5', '20091208174439', '0', '1']], 'X-RHN-Auth-User-Id': '', 'X-RHN-Auth-Expire-Offset': '3600.0'}
D: handle_action {'action': "<?xml version='1.0'?>\n<methodCall>\n<methodName>packages.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><array><data>\n<value><string>rhn-virtualization-host</string></value>\n<value><string>5.3.0</string></value>\n<value><string>14.el5sat</string></value>\n<value><string></string></value>\n<value><string>noarch</string></value>\n</data></array></value>\n</data></array></value>\n</param>\n</params>\n</methodCall>\n", 'version': 2, 'id': 1485}
D: handle_action actionid = 1485, version = 2
D: do_call packages.update ([['rhn-virtualization-host', '5.3.0', '14.el5sat', '', 'noarch']],)
Loaded plugins: rhnplugin
D: Called update [['rhn-virtualization-host', '5.3.0', '14.el5sat', '', 'noarch']]
D: Dependencies Resolved
D: Downloading Packages:
D: Running Transaction Test
D: Finished Transaction Test
D: Transaction Test Succeeded
D: Running Transaction
Updating package profile
D: Sending back response (0, 'Update Succeeded', {})
D: do_call packages.checkNeedUpdate ('rhnsd=1',)
D: Called refresh_rpmlist
Updating package profile
D: local action status:  (0, 'rpmlist refreshed', {})
[root@dhcp-lab-146 ~]# service crond status
crond is stopped

Comment 7 Alan Pevec 2009-12-09 19:25:55 UTC
verified based on my testing and comment 6

Comment 9 errata-xmlrpc 2009-12-10 11:13:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1660.html


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