Bug 1744200

Summary: Removing iscsi-initiator-utils leaves behind dangling systemd unit file
Product: Red Hat Enterprise Linux 8 Reporter: Oliver Falk <ofalk>
Component: iscsi-initiator-utilsAssignee: Chris Leech <cleech>
Status: CLOSED MIGRATED QA Contact: Martin Hoyer <mhoyer>
Severity: low Docs Contact:
Priority: low    
Version: 8.6CC: cleech, cww, fsuba, jbreitwe, mhoyer, peter.vreman
Target Milestone: rcKeywords: MigratedToJIRA, Reopened, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-23 12:55:33 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:
Embargoed:

Description Oliver Falk 2019-08-21 14:10:09 UTC
Description of problem:
If you remove iscsi-initiator-utils from a RHEL 7.7 system, it leaves behind a dangling symbolic link.


Version-Release number of selected component (if applicable): 6.2.0.874-11.el7 


How reproducible: Always.


Steps to Reproduce:
1. yum install iscsi-initiator-utils
2. yum install iscsi-initiator-utils
3. ls -l /etc/systemd/system/sockets.target.wants/iscsid*
   lrwxrwxrwx. 1 root root 37 Aug 21 09:28 /etc/systemd/system/sockets.target.wants/iscsid.socket -> /usr/lib/systemd/system/iscsid.socket
4. ls -l /usr/lib/systemd/system/iscsid.socket
   ls: cannot access /usr/lib/systemd/system/iscsid.socket: No such file or directory

Actual results:
After removal of the iscsi-initiator-utils, a dangling symbolic link is left behind.

Expected results:
After removal of iscsi-initrator-utils, there are no dangling symbolic links.


Additional info:
Customer case will be attached!

Comment 2 Peter Vreman 2020-04-21 13:27:22 UTC
The problem is that the %preuninstall of iscsi-initiator-utils wants do disable the iscsiuio.socket and iscsiuio.service that are already deleted before in the rpm transactions
This can be seen using 'sudo rpm -evvh iscsi-initiator-utils iscsi-initiator-utils-iscsiuio'

Reproducer to simulate the uninstall process:
- sudo yum install iscsi-initiator-utils
- sudo systemctl --no-reload disable iscsiuio.service iscsiuio.socket
Removed symlink /etc/systemd/system/sockets.target.wants/iscsiuio.socket.
- sudo rm -vf /usr/lib/systemd/system/iscsiuio.*
removed ‘/usr/lib/systemd/system/iscsiuio.service’
removed ‘/usr/lib/systemd/system/iscsiuio.socket’
- sudo systemctl --no-reload disable iscsi.service iscsi-onboot.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket
Failed to execute operation: Access denied

The Fix is to remove it iscsiuio.service and iscsiuio.socket from disable the command in the %preuninstall of iscsi-initiator-utils
- sudo systemctl --no-reload disable iscsi.service iscsi-onboot.service iscsi-shutdown.service iscsid.service iscsid.socket


In RHEL8.1 the same bug is present, but it is hidden because the rpm transaction does first the uninstall of  iscsi-initiator-utils befiore  iscsi-initiator-utils-scsiuio

Comment 7 Chris Williams 2020-11-11 21:48:50 UTC
Red Hat Enterprise Linux 7 shipped it's final minor release on September 29th, 2020. 7.9 was the last minor releases scheduled for RHEL 7.
From intial triage it does not appear the remaining Bugzillas meet the inclusion criteria for Maintenance Phase 2 and will now be closed. 

From the RHEL life cycle page:
https://access.redhat.com/support/policy/updates/errata#Maintenance_Support_2_Phase
"During Maintenance Support 2 Phase for Red Hat Enterprise Linux version 7,Red Hat defined Critical and Important impact Security Advisories (RHSAs) and selected (at Red Hat discretion) Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available."

If this BZ was closed in error and meets the above criteria please re-open it flag for 7.9.z, provide suitable business and technical justifications, and follow the process for Accelerated Fixes:
https://source.redhat.com/groups/public/pnt-cxno/pnt_customer_experience_and_operations_wiki/support_delivery_accelerated_fix_release_handbook  

Feature Requests can re-opened and moved to RHEL 8 if the desired functionality is not already present in the product. 

Please reach out to the applicable Product Experience Engineer[0] if you have any questions or concerns.  

[0] https://bugzilla.redhat.com/page.cgi?id=agile_component_mapping.html&product=Red+Hat+Enterprise+Linux+7

Comment 13 Martin Hoyer 2021-09-21 10:58:35 UTC
This does not seem to be an issue anymore on RHEL-8 and RHEL-9.

(In reply to Peter Vreman from comment #2)
> In RHEL8.1 the same bug is present, but it is hidden because the rpm
> transaction does first the uninstall of  iscsi-initiator-utils befiore 
> iscsi-initiator-utils-scsiuio

When running `rpm -evvh iscsi-initiator-utils-iscsiuio iscsi-initiator-utils`, the iscsiuio's %preun script is being run first and iscsi-initiator-utils's disable command looks fine. I was not able to reproduce dangling systemd unit files - am I missing something?

Comment 14 Peter Vreman 2021-09-21 12:27:29 UTC
On RHEL8.4 the rpm scripts are still not correct, the script in iscsi-initiator-utils still contains the iscsiuio.service iscsiuio.socket in its disable line, but it does not own the files.

But on RHEL8.4 the systemd command is more tolerant on the disbale that it ignores items not existing.

~~~
vrempet-admin@li-lc-2442 ~
$ sudo yum install iscsi-initiator-utils
Updating Subscription Management repositories.
HOICI-3.0.99-ci                                                                                                               26 kB/s | 2.1 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - SAP NetWeaver - Extended Update Support (RPMs)                                        30 kB/s | 2.3 kB     00:00
HOIOS-8.4.99-ci                                                                                                               29 kB/s | 2.1 kB     00:00
HOIPRODUCTS-3.0.99-ci                                                                                                         26 kB/s | 2.1 kB     00:00
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 - Extended Update Support (RPMs)                                            38 kB/s | 2.8 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS - Extended Update Support (RPMs)                                               31 kB/s | 2.4 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStream - Extended Update Support (RPMs)                                            37 kB/s | 2.8 kB     00:00
Red Hat Satellite Tools 6.9 for RHEL 8 x86_64 (RPMs)                                                                          25 kB/s | 2.1 kB     00:00
HOIRHEL-8.4-d20210919                                                                                                         23 kB/s | 2.1 kB     00:00
Dependencies resolved.
=============================================================================================================================================================
 Package                                     Architecture        Version                                Repository                                      Size
=============================================================================================================================================================
Installing:
 iscsi-initiator-utils                       x86_64              6.2.1.2-1.gita8fcb37.el8               rhel-8-for-x86_64-baseos-eus-rpms              379 k
Installing dependencies:
 iscsi-initiator-utils-iscsiuio              x86_64              6.2.1.2-1.gita8fcb37.el8               rhel-8-for-x86_64-baseos-eus-rpms              100 k

Transaction Summary
=============================================================================================================================================================
Install  2 Packages
...
Installed:
  iscsi-initiator-utils-6.2.1.2-1.gita8fcb37.el8.x86_64                    iscsi-initiator-utils-iscsiuio-6.2.1.2-1.gita8fcb37.el8.x86_64

Complete!

vrempet-admin@li-lc-2442 ~
$ sudo systemctl --no-reload disable iscsiuio.service iscsiuio.socket
Removed /etc/systemd/system/sockets.target.wants/iscsiuio.socket.

vrempet-admin@li-lc-2442 ~
$ sudo rm -vf /usr/lib/systemd/system/iscsiuio.*
removed '/usr/lib/systemd/system/iscsiuio.service'
removed '/usr/lib/systemd/system/iscsiuio.socket'

vrempet-admin@li-lc-2442 ~
$ sudo systemctl --no-reload disable iscsi.service iscsi-onboot.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket
Removed /etc/systemd/system/sysinit.target.wants/iscsi-onboot.service.
Removed /etc/systemd/system/sockets.target.wants/iscsid.socket.
Removed /etc/systemd/system/remote-fs.target.wants/iscsi.service.

vrempet-admin@li-lc-2442 ~
$
~~~


Although the rpm scripts are not perfect it works on RHEL8.4.
If you want you can therefor close it with CURRENTRELEASE

Comment 15 Martin Hoyer 2021-09-29 13:34:19 UTC
Thanks Peter!

Chris, please see comment#14.
I see you've already fixed it in upstream https://src.fedoraproject.org/rpms/iscsi-initiator-utils/c/c055794bdad05bd5c9ea9f1757440a8fd837cf52 and RHEL-9.
Do you want to pull that change to rhel-8 as well or close this bz?

Comment 16 Chris Leech 2021-10-07 18:44:46 UTC
(In reply to Martin Hoyer from comment #15)
> Thanks Peter!
> 
> Chris, please see comment#14.
> I see you've already fixed it in upstream
> https://src.fedoraproject.org/rpms/iscsi-initiator-utils/c/
> c055794bdad05bd5c9ea9f1757440a8fd837cf52 and RHEL-9.
> Do you want to pull that change to rhel-8 as well or close this bz?

I'll get this fixed in the next RHEL 8 build.

Just did a quick check over the various branches, I think 7.9.z should actually have a fix as of 6.2.0.874-19 it just wasn't tracked to this BZ.  

RHEL 9 looks good, I just need to fix the mistake in the RHEL 8 spec file.

Comment 18 Martin Hoyer 2023-01-13 18:02:41 UTC
(In reply to Chris Leech from comment #16)
> I'll get this fixed in the next RHEL 8 build.
> 
> Just did a quick check over the various branches, I think 7.9.z should
> actually have a fix as of 6.2.0.874-19 it just wasn't tracked to this BZ.  
> 
> RHEL 9 looks good, I just need to fix the mistake in the RHEL 8 spec file.

Hey Chris,
Just bumping this in case this bz was forgotten. 
Looking at 6.2.1.4-4.git095f59c.el8 specfile, it's still there.

Comment 20 RHEL Program Management 2023-09-23 12:54:23 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 21 RHEL Program Management 2023-09-23 12:55:33 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.

Comment 22 Red Hat Bugzilla 2024-04-14 04:25:16 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days