Bug 1185914

Summary: [RFE] rhn-migrate-classic-to-rhsm should give the option to remove RHN Classic related packages / daemons
Product: Red Hat Enterprise Linux 6 Reporter: Rich Jerrido <rjerrido>
Component: subscription-managerAssignee: Kevin Howell <khowell>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: high    
Version: 6.7CC: bcourt, bkearney, candlepin-bugs, dgoodwin, jgalipea, khowell, rjerrido, skallesh
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 10:53:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1172231, 1269194, 1355878, 1209535    

Description Rich Jerrido 2015-01-26 15:41:09 UTC
Description of problem:

As a user of rhn-migrate-classic-to-rhsm, I would like the option to disable/remove the various RHN related packages once I have migrated to a certificate based platform. 

This RFE requests the addition of: 

--disable-daemons option - Which disables the RHN daemons (osad, rhnsd)

and the 

--remove-rhn-packages - Which removes the various packages to include 

rhncfg-*
spacewalk-oscap
spacewalk-abrt
yum-rhn-plugin
osad
rhnpush
rhn-check
rhn-client-tools

--disable-daemons should be default behavior

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

subscription-manager-1.12.14-9.el6_6.x86_64

Comment 2 Barnaby Court 2016-07-13 14:51:38 UTC
For the RPL feature The goals are to 
1) Disable the RHN yum plugins 
2) Remove the RHN system id
3) Disable the daemons
4) (Optional) add the --remove-rhn-packages

Comment 5 Kevin Howell 2016-10-31 13:50:15 UTC
Rich, in implementation, I found the following packages for rhncfg-* (the implementation tries to remove these packages explicitly):
 - rhncfg
 - rhncfg-actions
 - rhncfg-client
 - rhncfg-management

We were wondering if customers ever create custom packages with the name "rhncfg-" and/or if the above list is complete (i.e. should we literally do the equivalent of `yum remove rhncfg-*`, instead of removing explicitly those packages listed above)?

Comment 6 Rich Jerrido 2016-10-31 16:46:33 UTC
customers can create custom packages with whatever name they'd like. I think the safer option is to remove them explicitly as 'yum remove rhncfg-*' may have undesired effects. 

The only rhncfg-* packages we ship are:

 - rhncfg-actions
 - rhncfg-client
 - rhncfg-management

Comment 8 Shwetha Kallesh 2016-11-09 08:28:48 UTC
Marking bug as verified

[root@rhel69-shwetha ~]# rhn-migrate-classic-to-rhsm --help | grep remove
  --remove-rhn-packages
                        remove legacy packages

Register to rhn:
-----------------------------
[root@rhel69-shwetha ~]# rhnreg_ks --username ******** --password ******


Verify status of rhnsd and osad deamons:
----------------------------------------------
[root@rhel69-shwetha ~]# service rhnsd status
rhnsd (pid  8162) is running...

[root@rhel69-shwetha ~]# service osad status
osad: unrecognized service

Check if following packages are installed:
--------------------------------------------------

[root@rhel69-shwetha ~]# for rpm in 'osad rhn-check rhn-client-tools rhncfg rhncfg-actions rhncfg-client rhncfg-management rhn-setup rhnpush rhnsd spacewalk-abrt spacewalk-oscap yum-rhn-plugin'; do rpm -q $rpm; done;
package osad is not installed
rhn-check-1.0.0.1-39.el6.noarch
rhn-client-tools-1.0.0.1-39.el6.noarch
package rhncfg is not installed
package rhncfg-actions is not installed
package rhncfg-client is not installed
package rhncfg-management is not installed
rhn-setup-1.0.0.1-39.el6.noarch
package rhnpush is not installed
rhnsd-4.9.3-5.el6.x86_64
package spacewalk-abrt is not installed
package spacewalk-oscap is not installed
yum-rhn-plugin-0.9.1-60.el6.noarch


Now try to migrate to rhsm using --remove-rhn-packages
---------------------------------------------------------

[root@rhel69-shwetha ~]# rhn-migrate-classic-to-rhsm --remove-rhn-packages Legacy username: qa@redhat.com
Legacy password: 
Retrieving existing legacy subscription information...

+-----------------------------------------------------+
System is currently subscribed to these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

+-----------------------------------------------------+
Installing product certificates for these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

Product certificates installed successfully to /etc/pki/product.

Preparing to unregister system from legacy server...
System successfully unregistered from legacy server.
Stopping and disabling legacy services...
osad: unrecognized service
osad: unrecognized service
Removing legacy packages...
No Match for argument: osad
No Match for argument: rhncfg
No Match for argument: rhncfg-actions
No Match for argument: rhncfg-client
No Match for argument: rhncfg-management
No Match for argument: rhnpush
No Match for argument: spacewalk-abrt
No Match for argument: spacewalk-oscap
warning: /etc/sysconfig/rhn/up2date saved as /etc/sysconfig/rhn/up2date.rpmsave

Attempting to register system to destination server...
Registering to: subscription.rhsm.redhat.com:443/subscription
The system has been registered with ID: 3b7edf8c-ed47-44f8-a9c4-6f03f21bf401 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

System 'rhel69-shwetha' successfully registered.


Now verify if following packages are removed:
----------------------------------------------------

[root@rhel69-shwetha ~]# for rpm in 'osad rhn-check rhn-client-tools rhncfg rhncfg-actions rhncfg-client rhncfg-management rhn-setup rhnpush rhnsd spacewalk-abrt spacewalk-oscap yum-rhn-plugin'; do rpm -q $rpm; done;
package osad is not installed
package rhn-check is not installed
package rhn-client-tools is not installed
package rhncfg is not installed
package rhncfg-actions is not installed
package rhncfg-client is not installed
package rhncfg-management is not installed
package rhn-setup is not installed
package rhnpush is not installed
package rhnsd is not installed
package spacewalk-abrt is not installed
package spacewalk-oscap is not installed
package yum-rhn-plugin is not installed


Verify status of rhnsd deamon that was running earlier:

[root@rhel69-shwetha ~]# service rhnsd status
rhnsd: unrecognized service

[root@rhel69-shwetha ~]# rhn-migrate-classic-to-rhsm --remove-rhn-packages 
Could not find up2date_client.config module! Perhaps this script was already executed with --remove-rhn-packages?

Comment 9 John Sefler 2016-11-14 15:27:55 UTC
Be aware that running rhn-migrate-classic-to-rhsm --remove-rhn-packages will also remove package subscription-manager-firstboot.  This is because subscription-manager-firstboot's dependency chain includes rhn-client-tools which is directly removed as verified in comment 8.


Additional Info:
[root@jsefler-rhel6 ~]# rpm -q --whatrequires rhn-setup
yum-rhn-plugin-0.9.1-60.el6.noarch
rhn-setup-gnome-1.0.0.1-39.el6.noarch
[root@jsefler-rhel6 ~]# rpm -q --whatrequires rhn-setup-gnome
subscription-manager-firstboot-1.18.4-1.el6.x86_64
[root@jsefler-rhel6 ~]#

Comment 11 errata-xmlrpc 2017-03-21 10:53:38 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-2017-0698.html