diff --git a/SOURCES/bz1841831-podman-force-rm-container-if-rm-fails.patch b/SOURCES/bz1841831-podman-force-rm-container-if-rm-fails.patch deleted file mode 100644 index 89fbb06..0000000 --- a/SOURCES/bz1841831-podman-force-rm-container-if-rm-fails.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 5a732511db2c49ff6afe0a20e738b565a35273ae Mon Sep 17 00:00:00 2001 -From: Damien Ciabrini -Date: Fri, 29 May 2020 11:57:29 +0200 -Subject: [PATCH] podman: make sure to remove containers with lingering exec - sessions - -It may happen that some "podman exec" commands don't finish -cleanly and leave lingering "Exec sessions" in the container's -state. In that case, a "podman rm" command will always fail. - -To overcome the podman bug, issue a "podman rm -f" command when -we detect a container is stopped but still has some lingering -"Exec sessions" associated with it. - -Related-Bug: rhbz#1839721 ---- - heartbeat/podman | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/heartbeat/podman b/heartbeat/podman -index f77d988fc..e2f6e981b 100755 ---- a/heartbeat/podman -+++ b/heartbeat/podman -@@ -232,6 +232,9 @@ container_exists() - - remove_container() - { -+ local rc -+ local execids -+ - if ocf_is_true "$OCF_RESKEY_reuse"; then - # never remove the container if we have reuse enabled. - return 0 -@@ -244,6 +247,19 @@ remove_container() - fi - ocf_log notice "Cleaning up inactive container, ${CONTAINER}." - ocf_run podman rm $CONTAINER -+ rc=$? -+ if [ $rc -ne 0 ]; then -+ # due to a podman bug (rhbz#1841485), sometimes a stopped -+ # container can still be associated with Exec sessions, in -+ # which case the "podman rm" has to be forced -+ execids=$(podman inspect $CONTAINER --format '{{len .ExecIDs}}') -+ if [ "$execids" -ne "0" ]; then -+ ocf_log warn "Inactive container ${CONTAINER} has lingering exec sessions. Force-remove it." -+ ocf_run podman rm -f $CONTAINER -+ rc=$? -+ fi -+ fi -+ return $rc - } - - podman_simple_status() diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 2e9e451..ac1fbad 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -66,7 +66,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.1.1 -Release: 44%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}.3 +Release: 44%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}.2 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -190,7 +190,6 @@ Patch103: bz1808468-1-lvmlockd-fix-conditionals.patch Patch104: bz1808468-2-remove-locking_type.patch Patch105: bz1822250-aws-vpc-move-ip-delete-remaining-route-entries.patch Patch106: bz1832859-rabbitmq-cluster-increase-wait-timeout.patch -Patch107: bz1841831-podman-force-rm-container-if-rm-fails.patch # bundle patches Patch1000: 7-gcp-bundled.patch @@ -446,7 +445,6 @@ exit 1 %patch104 -p1 %patch105 -p1 %patch106 -p1 -%patch107 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -991,11 +989,6 @@ ccs_update_schema > /dev/null 2>&1 ||: %endif %changelog -* Tue Jun 2 2020 Oyvind Albrigtsen - 4.1.1-44.3 -- podman: force remove container if remove fails - - Resolves: rhbz#1841831 - * Thu May 7 2020 Oyvind Albrigtsen - 4.1.1-44.2 - rabbitmq-cluster: increase rabbitmqctl wait timeout during start