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 2097865 - Removing podman-2:4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64 does not remove podman socket if sudo systemctl enable podman.socket has been run prior to yum remove podman
Summary: Removing podman-2:4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64 does not remov...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.6
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Jindrich Novy
QA Contact: Joy Pu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-16 18:46 UTC by Matt Mezynski
Modified: 2022-11-08 09:34 UTC (History)
13 users (show)

Fixed In Version: podman-4.1.1-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 09:16:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-125523 0 None None None 2022-06-16 18:54:22 UTC
Red Hat Product Errata RHSA-2022:7457 0 None None None 2022-11-08 09:16:49 UTC

Description Matt Mezynski 2022-06-16 18:46:37 UTC
Description of problem:
If podman-2:4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64 is installed and the podman socket is enabled via systemctl, on yum remove podman the podman.socket remains.

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

podman-2:4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64

How reproducible:
always

Steps to Reproduce:
1. yum install podman-2:4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64
2. sudo systemctl enable podman.socket
3. yum remove podman-2:4.0.2-6.module+el8.6.0+14877+f643d2d6.x86_64
4. ls -l /etc/systemd/system/sockets.target.wants
total 0
lrwxrwxrwx. 1 root root 39 May 19  2021 dm-event.socket -> /usr/lib/systemd/system/dm-event.socket
lrwxrwxrwx. 1 root root 37 Jun 16 11:06 podman.socket -> /usr/lib/systemd/system/podman.socket

Actual results:
socket still persists


Expected results:
socket should be removed

Additional info:
N/A

Comment 4 Jindrich Novy 2022-06-30 11:42:03 UTC
I added this to the podman spec file:

%postun
systemctl stop podman.socket > /dev/null 2>&1
systemctl disable podman.socket > /dev/null 2>&1
:

Comment 5 Daniel Walsh 2022-06-30 12:28:43 UTC
Should that only be done, if this is a full removal?  IE On upgrade will this leave us in a bad state.

Comment 6 Jindrich Novy 2022-06-30 17:00:28 UTC
Makes sense. I changed it to:

%postun
if [ $1 == 0 ]; then
  systemctl stop podman.socket > /dev/null 2>&1
  systemctl disable podman.socket > /dev/null 2>&1
fi
:

to assure it's executed on removal only.

Now, the last question - does it make sense to run this before or after podman package removal? Assuming in %postun, not %preun to not to step on podman's (still installed) feet?

Comment 7 Daniel Walsh 2022-06-30 17:22:39 UTC
I would think it has to be PREUN, since those commands are likely (POtentially) to execute podman commands.

Do we need to do 
systemctl stop podman.service
systemctl disable podman.service

as well.

Comment 8 Jindrich Novy 2022-06-30 17:40:01 UTC
Ok, the final variant looks like this:

%preun
if [ $1 == 0 ]; then
  systemctl stop podman.service > /dev/null 2>&1
  systemctl stop podman.socket > /dev/null 2>&1
  systemctl disable podman.service > /dev/null 2>&1
  systemctl disable podman.socket > /dev/null 2>&1
fi
:

Dan, PTAL

Comment 9 Daniel Walsh 2022-06-30 17:59:15 UTC
LGTM

Comment 10 Joy Pu 2022-07-15 14:49:48 UTC
Checked with podman-2:4.1.1-6.module+el8.7.0+15895+a6753917.x86_64 and after remove the podman rpm, the podman.socket files are clean up as expected. More details:
Output from step 4:
[root@sweetpig-21 ~]#  ls -l /etc/systemd/system/sockets.target.wants
total 0
lrwxrwxrwx. 1 root root 39 Jul 15 05:55 dm-event.socket -> /usr/lib/systemd/system/dm-event.socket
lrwxrwxrwx. 1 root root 39 Jul 15 05:55 sssd-kcm.socket -> /usr/lib/systemd/system/sssd-kcm.socket
[root@sweetpig-21 ~]# ls /usr/lib/systemd/system/podman.socket
ls: cannot access '/usr/lib/systemd/system/podman.socket': No such file or directory

So set Tested flag.

Comment 13 Joy Pu 2022-08-31 03:57:32 UTC
Tested with podman-2:4.2.0-1.module+el8.7.0+16493+89f82ab8.x86_64 and the output from step 4:
# ls -l /etc/systemd/system/sockets.target.wants
total 0
lrwxrwxrwx. 1 root root 39 Aug 29 09:39 dm-event.socket -> /usr/lib/systemd/system/dm-event.socket
lrwxrwxrwx. 1 root root 39 Aug 29 09:39 sssd-kcm.socket -> /usr/lib/systemd/system/sssd-kcm.socket

So move it to verified.

Comment 15 errata-xmlrpc 2022-11-08 09:16:27 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 (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), 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/RHSA-2022:7457


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