RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1432231 - rhn-migrate-classic-to-rhsm is failing to stop and disable services
Summary: rhn-migrate-classic-to-rhsm is failing to stop and disable services
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-14 20:30 UTC by John Sefler
Modified: 2021-03-11 15:03 UTC (History)
4 users (show)

Fixed In Version: subscription-manager-1.19.15-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:21:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1629 0 None closed 1432231: Support /etc/init.d daemon even on EL7 2020-11-03 10:17:37 UTC
Red Hat Product Errata RHBA-2017:2083 0 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-08-01 18:14:19 UTC

Description John Sefler 2017-03-14 20:30:56 UTC
Description of problem:
Newly introduced by RFE Bug 1185914 is an automatic feature that stops and disables services [osad,rhnsd].  Unfortunately it is not stopping services on RHEL7.  See reproducer.


Version-Release number of selected component (if applicable):
[root@jsefler-rhel7 ~]# rpm -q subscription-manager-migration python-rhsm systemd rhnsd osad
subscription-manager-migration-1.19.1-1.git.832.46d4712.el7.x86_64
python-rhsm-1.19.1-1.git.5753.46d4712.el7.x86_64
systemd-219-30.el7.x86_64
rhnsd-5.0.13-5.el7.x86_64
package osad is not installed


How reproducible:
repeatable

Steps to Reproduce:
[root@jsefler-rhel7 ~]# rhnreg_ks --serverUrl=https://rhsm-sat5.usersys.redhat.com/XMLRPC --username=rhsm-client --password=REDACTED --profilename=rhsm-automation.jsefler-rhel7.usersys.redhat.com --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# systemctl is-active rhnsd
active
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# service rhnsd status
● rhnsd.service - LSB: Starts the Spacewalk Daemon
   Loaded: loaded (/etc/rc.d/init.d/rhnsd; bad; vendor preset: disabled)
   Active: active (running) since Fri 2017-03-03 08:35:25 EST; 1 weeks 4 days ago
     Docs: man:systemd-sysv-generator(8)
 Main PID: 1112 (rhnsd)
   CGroup: /system.slice/rhnsd.service
           └─1112 rhnsd

Mar 12 23:15:58 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 13 03:15:58 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 13 07:15:58 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 13 11:15:58 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 13 16:20:06 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 13 20:20:06 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 14 00:20:06 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 14 04:20:06 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 14 08:20:06 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
Mar 14 12:20:06 jsefler-rhel7.usersys.redhat.com rhnsd[1112]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
enabled
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# chkconfig --list rhnsd

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

rhnsd          	0:off	1:off	2:on	3:on	4:on	5:on	6:off
[root@jsefler-rhel7 ~]# 

NOTE ABOVE THAT WE ARE REGISTERED CLASSICALLY AND rhnsd IS ACTIVE AND ENABLED, NOW LET'S MIGRATE...

[root@jsefler-rhel7 ~]# rhn-migrate-classic-to-rhsm --legacy-user=rhsm-client --legacy-password=REDACED --destination-url=subscription.rhsm.stage.redhat.com:443/subscription --destination-user=qa --destination-password=REDACTED

Retrieving existing legacy subscription information...

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

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

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...

Attempting to register system to destination server...
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 514b588a-1bf6-4bd1-b9bc-3f3f59525c55 

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

System 'jsefler-rhel7.usersys.redhat.com' successfully registered.

[root@jsefler-rhel7 ~]# echo $?
0

NOTE THAT THE MIGRATION ABOVE APPEARS SUCCESSFUL AND THE OUTPUT INDICATES "Stopping and disabling legacy services...
" AND /var/log/rhsm/rhsm.log CONTAINS THIS SNIPPET WHICH DOES NOT INDICATE ANY TROUBLE WHILE "Attempting to stop and disable legacy services: osad rhnsd..."

2017-03-14 16:06:57,109 [INFO] rhn-migrate-classic-to-rhsm:11442:MainThread @migrate.py:544 - Copying /usr/share/rhsm/product/RHEL-7/Server-Server-x86_64-9504e60fcb1a-69.pem to /etc/pki/product/69.pem 
2017-03-14 16:06:57,112 [INFO] rhn-migrate-classic-to-rhsm:11442:MainThread @migrate.py:638 - Deleting system 1000051843 from legacy server...
2017-03-14 16:06:57,140 [INFO] rhn-migrate-classic-to-rhsm:11442:MainThread @migrate.py:652 - System 1000051843 deleted.  Removing system id file and disabling rhnplugin.conf
2017-03-14 16:06:57,140 [INFO] rhn-migrate-classic-to-rhsm:11442:MainThread @migrate.py:607 - Disabling rhnplugin.conf
2017-03-14 16:06:57,142 [INFO] rhn-migrate-classic-to-rhsm:11442:MainThread @migrate.py:813 - Attempting to stop and disable legacy services: osad rhnsd
2017-03-14 16:06:57,575 [DEBUG] subscription-manager:11453:MainThread @https.py:54 - Using standard libs to provide httplib and ssl
2017-03-14 16:06:57,695 [DEBUG] subscription-manager:11453:MainThread @dbus_interface.py:35 - self.has_main_loop=False
2017-03-14 16:06:57,765 [DEBUG] subscription-manager:11453:MainThread @ga_loader.py:89 - ga_loader GaImporterGtk3
2017-03-14 16:06:57,774 [DEBUG] subscription-manager:11453:MainThread @plugins.py:569 - loaded plugin modules: [<module 'container_content' from '/usr/share/rhsm-plugins/container_content.pyc'>, <module 'ostree_content' from '/usr/share/rhsm-plugins/ostree_content.pyc'>]

NOW LET'S CONFIRM THAT rhnsd WAS STOPPED AND DISABLED....

[root@jsefler-rhel7 ~]# systemctl is-active rhnsd
active
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
enabled
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# 


Actual results:
 FAILED TO STOP AND DISABLE rhnsd

Expected results:
 As indicated under USAGE section of the man page..  
    The script runs through these steps:
         6. Stop and disable legacy services: osad, rhnsd.




Additional info:
  I believe the rhn-migrate-classic-to-rhsm script is making a call to "systemctl list-unit-files rhnsd.service" which is reporting the following... (which falsely appears as though rhnsd it is not installed)  It might be more reliable to call "systemctl list-unit-files rhnsd.service".

[root@jsefler-rhel7 ~]# systemctl list-unit-files rhnsd.service
UNIT FILE STATE

0 unit files listed.
[root@jsefler-rhel7 ~]#
[root@jsefler-rhel7 ~]# systemctl list-units rhnsd.service
UNIT          LOAD   ACTIVE SUB     DESCRIPTION
rhnsd.service loaded active running LSB: Starts the Spacewalk Daemon

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
[root@jsefler-rhel7 ~]#

Comment 3 Rehana 2017-05-29 11:03:46 UTC
Reproducing the failure: 
========================

# rpm -q subscription-manager-migration python-rhsm systemd rhnsd osad
subscription-manager-migration-1.19.9-1.el7.x86_64
python-rhsm-1.19.5-1.el7.x86_64
systemd-219-39.el7.x86_64
rhnsd-5.0.13-7.el7.x86_64

[root@dhcp35-71 home]# rhnreg_ks --serverUrl=https://rhsm-sat5.usersys.redhat.com/XMLRPC --username=rhsm-client --password=**** --profilename=rhsmtest --force --norhnsd --nohardware --nopackages --novirtinfo

[root@dhcp35-71 home]# systemctl is-active rhnsd
active
[root@dhcp35-71 home]#  service rhnsd status
● rhnsd.service - LSB: Starts the Spacewalk Daemon
   Loaded: loaded (/etc/rc.d/init.d/rhnsd; bad; vendor preset: disabled)
   Active: active (running) since Wed 2017-05-10 15:47:41 IST; 2 weeks 4 days ago
     Docs: man:systemd-sysv-generator(8)
 Main PID: 1113 (rhnsd)
   CGroup: /system.slice/rhnsd.service
           └─1113 rhnsd

May 14 21:46:21 dhcp35-238.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 15 01:46:21 dhcp35-238.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 15 05:46:21 dhcp35-238.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 15 09:46:21 dhcp35-238.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 15 13:46:21 dhcp35-238.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 16 00:24:14 dhcp35-238.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 16 04:24:14 dhcp35-71.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 16 08:24:14 dhcp35-71.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 16 12:24:14 dhcp35-71.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 16 16:24:14 dhcp35-71.lab.eng.blr.redhat.com rhnsd[1113]: /etc/sysconfig/rhn/systemid does not exist or is unreadable

[root@dhcp35-71 home]# systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
enabled

[root@dhcp35-71 home]# systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
enabled

[root@dhcp35-71 home]#  chkconfig --list rhnsd

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

rhnsd          	0:off	1:off	2:on	3:on	4:on	5:on	6:off


[root@dhcp35-71 home]# rhn-migrate-classic-to-rhsm --legacy-user=rhsm-client --legacy-password=**** --destination-url=subscription.rhsm.stage.redhat.com:443/subscription --destination-user=qa --destination-password=*****

Retrieving existing legacy subscription information...

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

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

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...

Attempting to register system to destination server...
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: c22b33c8-6eeb-4cfe-b06a-2d79ff5555d2 

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

System 'dhcp35-71.lab.eng.blr.redhat.com' successfully registered.

[root@dhcp35-71 home]# echo $?
0

[root@dhcp35-71 home]# systemctl is-active rhnsd
active

[root@dhcp35-71 home]#  systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
enabled

^^ observed that rhnsd was still enabled on the system. 

VERIFYING on latest subscription-manager build :
====================================================

#  rpm -q subscription-manager-migration python-rhsm systemd rhnsd osad
subscription-manager-migration-1.19.16-1.el7.x86_64
python-rhsm-1.19.7-1.el7.x86_64
systemd-219-39.el7.x86_64
rhnsd-5.0.13-7.el7.x86_64
package osad is not installed

[root@dhcp151-206 tester]# rhnreg_ks --serverUrl=https://rhsm-sat5.usersys.redhat.com/XMLRPC --username=rhsm-client --password=**** --profilename=rhsmtest --force --norhnsd --nohardware --nopackages --novirtinfo

[root@dhcp151-206 tester]# systemctl is-active rhnsd
active
[root@dhcp151-206 tester]# service rhnsd status
● rhnsd.service - LSB: Starts the Spacewalk Daemon
   Loaded: loaded (/etc/rc.d/init.d/rhnsd; bad; vendor preset: disabled)
   Active: active (running) since Fri 2017-05-26 09:58:47 EDT; 2 days ago
     Docs: man:systemd-sysv-generator(8)
 Main PID: 1191 (rhnsd)
   CGroup: /system.slice/rhnsd.service
           └─1191 rhnsd

May 27 17:13:13 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 27 21:13:13 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 28 01:13:13 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 28 05:13:13 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 28 09:13:13 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 28 12:17:14 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 28 16:17:14 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 28 20:17:14 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 29 00:17:14 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable
May 29 04:17:14 dhcp151-206.mpc.lab.eng.bos.redhat.com rhnsd[1191]: /etc/sysconfig/rhn/systemid does not exist or is unreadable

[root@dhcp151-206 tester]# systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
enabled

[root@dhcp151-206 tester]# chkconfig --list rhnsd

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

rhnsd          	0:off	1:off	2:on	3:on	4:on	5:on	6:off

[root@dhcp151-206 tester]# rhn-migrate-classic-to-rhsm --legacy-user=rhsm-client --legacy-password=**** --destination-url=subscription.rhsm.stage.redhat.com:443/subscription --destination-user=qa --destination-password=*****

Retrieving existing legacy subscription information...

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

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

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...
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd off

Attempting to register system to destination server...
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 343b31fa-7eed-4dab-a642-4fb90351091e 

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

Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed

System 'dhcp151-206.mpc.lab.eng.bos.redhat.com' successfully registered.


^^ observed that now stopping service is redirecting to /sbin/chkconfig and the services are now disabled post migration

[root@dhcp151-206 tester]#  systemctl is-active rhnsd
unknown

[root@dhcp151-206 tester]# systemctl is-enabled rhnsd
rhnsd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rhnsd --level=5
disabled

based on the above observations , moving this bug to verified!!

Comment 4 errata-xmlrpc 2017-08-01 19:21:47 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://access.redhat.com/errata/RHBA-2017:2083


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