diff --git a/SOURCES/bz2151293-SAPInstance-improve-killsap-logic.patch b/SOURCES/bz2151293-SAPInstance-improve-killsap-logic.patch new file mode 100644 index 0000000..325c3b6 --- /dev/null +++ b/SOURCES/bz2151293-SAPInstance-improve-killsap-logic.patch @@ -0,0 +1,46 @@ +From 08ed464aa803f03cbb6cabc79afe462fc98ad213 Mon Sep 17 00:00:00 2001 +From: Fabian Herschel +Date: Mon, 5 Dec 2022 18:13:36 +0100 +Subject: [PATCH 1/2] SAPInstance: be more resilient against broken kill.sap + files + +--- + heartbeat/SAPInstance | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance +index e3fe788ae..fbf6c5245 100755 +--- a/heartbeat/SAPInstance ++++ b/heartbeat/SAPInstance +@@ -830,7 +830,7 @@ sapinstance_status() { + local pids + + [ ! -f "/usr/sap/$SID/$InstanceName/work/kill.sap" ] && return $OCF_NOT_RUNNING +- pids=`grep '^kill -[0-9]' /usr/sap/$SID/$InstanceName/work/kill.sap | awk '{print $3}'` ++ pids=$(awk '$3 ~ "[0-9]+" { print $3 }' /usr/sap/$SID/$InstanceName/work/kill.sap) + for pid in $pids + do + [ `pgrep -f -U $sidadm $InstanceName | grep -c $pid` -gt 0 ] && return $OCF_SUCCESS + +From a7153dd3f31fe5a14bf76d367cd8185848821fcd Mon Sep 17 00:00:00 2001 +From: Fabian Herschel +Date: Tue, 6 Dec 2022 09:15:56 +0100 +Subject: [PATCH 2/2] SAPInstance: Also need the begin-end markers + +--- + heartbeat/SAPInstance | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance +index fbf6c5245..26fd54136 100755 +--- a/heartbeat/SAPInstance ++++ b/heartbeat/SAPInstance +@@ -830,7 +830,7 @@ sapinstance_status() { + local pids + + [ ! -f "/usr/sap/$SID/$InstanceName/work/kill.sap" ] && return $OCF_NOT_RUNNING +- pids=$(awk '$3 ~ "[0-9]+" { print $3 }' /usr/sap/$SID/$InstanceName/work/kill.sap) ++ pids=$(awk '$3 ~ "^[0-9]+$" { print $3 }' /usr/sap/$SID/$InstanceName/work/kill.sap) + for pid in $pids + do + [ `pgrep -f -U $sidadm $InstanceName | grep -c $pid` -gt 0 ] && return $OCF_SUCCESS diff --git a/SPECS/resource-agents-sap.spec b/SPECS/resource-agents-sap.spec index 2b3126e..5f85454 100644 --- a/SPECS/resource-agents-sap.spec +++ b/SPECS/resource-agents-sap.spec @@ -48,11 +48,12 @@ Name: resource-agents-sap Summary: SAP cluster resource agents Version: 4.10.0 -Release: 2%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz Source1: %{sap_script_prefix}-%{sap_script_hash}.tar.gz +Patch0: bz2151293-SAPInstance-improve-killsap-logic.patch BuildArch: noarch @@ -93,6 +94,7 @@ SAP instances to be managed in a cluster environment. %prep %setup -q -n %{upstream_prefix}-%{upstream_version} %setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version} +%patch0 -p1 %build if [ ! -f configure ]; then @@ -176,6 +178,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %exclude /usr/src %changelog +* Wed Dec 07 2022 Janine Fuchs - 4.10.0-3 +- SAPInstance: be more resilient against broken kill.sap files + + Resolves: rhbz#2151293 + * Mon Nov 22 2021 Oyvind Albrigtsen - 4.10.0-2 - Rebase to resource-agents 4.10.0 upstream release.