diff --git a/.gitignore b/.gitignore index 1b29d29..1be512b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz -SOURCES/SAPHanaSR-d1dde99.tar.gz +SOURCES/SAPHanaSR-6281418.tar.gz diff --git a/.resource-agents-sap-hana.metadata b/.resource-agents-sap-hana.metadata index 905dadd..e858b1c 100644 --- a/.resource-agents-sap-hana.metadata +++ b/.resource-agents-sap-hana.metadata @@ -1,2 +1,2 @@ 0358e1cb7fe86b2105bd2646cbe86f3c0273844a SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz -442679403d1287835841d70c5bef208a330c2c11 SOURCES/SAPHanaSR-d1dde99.tar.gz +8d25b08bed4b158d83a2884588a345374efdb500 SOURCES/SAPHanaSR-6281418.tar.gz diff --git a/SOURCES/bz1855885-SAPHana-use-actual-mode.patch b/SOURCES/bz1855885-SAPHana-use-actual-mode.patch deleted file mode 100644 index e4c43eb..0000000 --- a/SOURCES/bz1855885-SAPHana-use-actual-mode.patch +++ /dev/null @@ -1,59 +0,0 @@ -From ec9fd4e526e572fe9bc0070186fa584b032eac22 Mon Sep 17 00:00:00 2001 -From: AngelaBriel -Date: Fri, 5 Mar 2021 19:18:02 +0100 -Subject: [PATCH] during the function 'check_for_primary' sometimes the command - 'hdbnsutil' does not work, but timed out. As a fallback we use - 'getParameter.py' to get some parameter values from the global.ini file. In - the past the use of the variable 'mode' was sufficient, but now we more often - see the problem, that this variable does not contain the current mode of the - node. So we will switch to the variable 'actual_mode', which will be more - reliable updated by the SAP software and will (hopefully) provide us with the - current mode of the node in times, where 'hdbnsutil' refuse to answer. This - change will help to avoid the irritating and confusing message 'secondary has - unexpected sync status PRIM ==> RESCORE' on a primary node as seen in - bsc#1181765 - ---- - heartbeat/SAPHana | 20 ++++++++++++++------ - 1 file changed, 14 insertions(+), 6 deletions(-) - -diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana -index 64e61e8..cd91ddf 100755 ---- a/heartbeat/SAPHana -+++ b/heartbeat/SAPHana -@@ -1054,21 +1054,29 @@ function check_for_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" - local rc=$HANA_STATE_DEFECT - # TODO: PRIO 3: Check beginning from which SPS does SAP support HDBSettings.sh? -- # TODO: Limit the runtime of hdbnsutil and use getParameter.py as fallback -- # TODO: PRIO2: Maybe we need to use a fallback interface when hdbnsutil does not answer properly -> lookup in config files? -- # This might also solve some problems when we could not figure-out the ilocal or remote site name -+ # DONE: Limit the runtime of hdbnsutil and use getParameter.py as fallback -+ # DONE: PRIO2: Maybe we need to use a fallback interface when hdbnsutil does not answer properly -> lookup in config files? -+ # TODO: This might also solve some problems when we could not figure-out the local or remote site name (site_name,site_id from global.ini) - local chkMethod="" -+ local ini_mode="" - for chkMethod in hU hU hU gP; do - case "$chkMethod" in - gP ) -+ # fallback for 'hdbnsutil' failing 3 times. - local gpKeys="" -- gpKeys=$(echo --key=global.ini/system_replication/{mode,site_name,site_id}) -+ gpKeys=$(echo --key=global.ini/system_replication/{actual_mode,mode}) - node_full_status=$(HANA_CALL --timeout "$HANA_CALL_TIMEOUT" --cmd "HDBSettings.sh getParameter.py $gpKeys --sapcontrol=1" 2>&1 | awk -F/ 'BEGIN {out=0} /^SAPCONTROL-OK: / { out=1 } /^SAPCONTROL-OK: / { out=0 } /=/ {if (out==1) {print $3} }') -- node_status=$(echo "$node_full_status" | awk -F= '$1=="mode" {print $2}') -+ # first try to get the value of 'actual_mode' from the global.ini -+ ini_mode=$(echo "$node_full_status" | awk -F= '$1=="actual_mode" {print $2}') -+ # if 'actual_mode' is not available, fallback to 'mode' -+ if [ -z "$ini_mode" ]; then -+ ini_mode=$(echo "$node_full_status" | awk -F= '$1=="mode" {print $2}') -+ fi -+ node_status="$ini_mode" - super_ocf_log info "ACT: Using getParameter.py as fallback - node_status=$node_status" - ;; - hU | * ) -- # DONE: PRIO1: Begginning from SAP HANA rev 112.03 -sr_state is not longer supported -+ # DONE: PRIO1: Beginning from SAP HANA rev 112.03 -sr_state is not longer supported - node_full_status=$(HANA_CALL --timeout "$HANA_CALL_TIMEOUT" --cmd "$hdbState" 2>/dev/null ) - node_status=$(echo "$node_full_status" | awk '$1=="mode:" {print $2}') - super_ocf_log debug "DBG: check_for_primary: node_status=$node_status" diff --git a/SOURCES/bz2026273-1-SAPHana-SAPHanaTopology-add-systemd-support.patch b/SOURCES/bz2026273-1-SAPHana-SAPHanaTopology-add-systemd-support.patch deleted file mode 100644 index d46744c..0000000 --- a/SOURCES/bz2026273-1-SAPHana-SAPHanaTopology-add-systemd-support.patch +++ /dev/null @@ -1,315 +0,0 @@ -From 496f6ab824c51e08c9acc0e50c79495db55f90e8 Mon Sep 17 00:00:00 2001 -From: AngelaBriel -Date: Wed, 24 Nov 2021 15:58:36 +0100 -Subject: [PATCH] add support for the new systemd unit file handling for - sapstartsrv and saphostagent (bsc#1189530, bsc#1189531) - ---- - heartbeat/SAPHana | 148 +++++++++++++++++++++++++++---------------- - heartbeat/SAPHanaTopology | 71 ++++++++++++++++++--- - 5 files changed, 173 insertions(+), 66 deletions(-) - -diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana -index 5da587d..aaff777 100755 ---- a/heartbeat/SAPHana -+++ b/heartbeat/SAPHana -@@ -714,6 +714,7 @@ function saphana_init() { - super_ocf_log info "FLOW $FUNCNAME ($*)" - local rc=$OCF_SUCCESS - local clN -+ SYSTEMCTL="/usr/bin/systemctl" - # local site - # two parameter models (for transition only) - # OLD: InstanceName -@@ -944,6 +945,26 @@ function check_secstore_users() - return $rc - } - -+# chk4systemdsupport - check, if SAP systemd support is available -+# check for the existence of the SAP SID+Instance related unit file -+# rc=0 - sap instance unit file exists -+# rc=1 - sap instance unit file does NOT exist -+function chk4systemdsupport() { -+ super_ocf_log info "FLOW ${FUNCNAME[0]}" -+ local systemd_unit_name="SAP${SID}_${InstanceNr}.service" -+ local rc=1 -+ if [ -x "$SYSTEMCTL" ]; then -+ if [ -f /etc/systemd/system/"$systemd_unit_name" ]; then -+ rc=0 -+ elif $SYSTEMCTL list-unit-files "$systemd_unit_name"; then -+ rc=0 -+ else -+ rc=1 -+ fi -+ fi -+ return $rc -+} -+ - # - # function: check_sapstartsrv - check for sapstartsrv - optional start - # params: - -@@ -956,67 +977,86 @@ function check_sapstartsrv() { - local runninginst="" - local rc=$OCF_SUCCESS - local output="" -- if [ ! -S /tmp/.sapstream5${InstanceNr}13 ]; then -- super_ocf_log warn "ACT: sapstartsrv is not running for instance $SID-$InstanceName (no UDS), it will be started now" -- restart=1 -+ if chk4systemdsupport; then -+ # use systemd to control sapstartsrv -+ local systemd_unit_name="SAP${SID}_${InstanceNr}.service" -+ -+ if $SYSTEMCTL is-active --quiet "$systemd_unit_name"; then -+ super_ocf_log info "ACT: systemd service $systemd_unit_name is active" -+ else -+ super_ocf_log warn "ACT: systemd service $systemd_unit_name is not active, it will be started using systemd" -+ # use start, because restart does also stop sap instance -+ $SYSTEMCTL start "$systemd_unit_name" >/dev/null 2>&1; src=$? -+ if [ $src -ne 0 ]; then -+ super_ocf_log error "ACT: error during start of systemd unit ${systemd_unit_name}!" -+ rc=$OCF_ERR_GENERIC -+ ocf_is_probe && rc=$OCF_NOT_RUNNING -+ fi -+ fi - else -- output=$($SAPCONTROL -nr $InstanceNr -function ParameterValue INSTANCE_NAME -format script) -- if [ $? -eq 0 ] -- then -- runninginst=$(echo "$output" | grep '^0 : ' | cut -d' ' -f3) -- if [ "$runninginst" != "$InstanceName" ] -+ # no SAP systemd unit available, continue with old code... -+ if [ ! -S /tmp/.sapstream5${InstanceNr}13 ]; then -+ super_ocf_log warn "ACT: sapstartsrv is not running for instance $SID-$InstanceName (no UDS), it will be started now" -+ restart=1 -+ else -+ output=$($SAPCONTROL -nr $InstanceNr -function ParameterValue INSTANCE_NAME -format script) -+ if [ $? -eq 0 ] - then -- super_ocf_log warn "ACT: sapstartsrv is running for instance $runninginst, that service will be killed" -- restart=1 -- else -- output=$($SAPCONTROL -nr $InstanceNr -function AccessCheck Start) -- if [ $? -ne 0 ]; then -- super_ocf_log warn "ACT: FAILED - sapcontrol -nr $InstanceNr -function AccessCheck Start ($(ls -ld1 /tmp/.sapstream5${InstanceNr}13))" -- super_ocf_log warn "ACT: sapstartsrv will be restarted to try to solve this situation, otherwise please check sapstsartsrv setup (SAP Note 927637)" -+ runninginst=$(echo "$output" | grep '^0 : ' | cut -d' ' -f3) -+ if [ "$runninginst" != "$InstanceName" ] -+ then -+ super_ocf_log warn "ACT: sapstartsrv is running for instance $runninginst, that service will be killed" - restart=1 -+ else -+ output=$($SAPCONTROL -nr $InstanceNr -function AccessCheck Start) -+ if [ $? -ne 0 ]; then -+ super_ocf_log warn "ACT: FAILED - sapcontrol -nr $InstanceNr -function AccessCheck Start ($(ls -ld1 /tmp/.sapstream5${InstanceNr}13))" -+ super_ocf_log warn "ACT: sapstartsrv will be restarted to try to solve this situation, otherwise please check sapstsartsrv setup (SAP Note 927637)" -+ restart=1 -+ fi - fi -+ else -+ super_ocf_log warn "ACT: sapstartsrv is not running for instance $SID-$InstanceName, it will be started now" -+ restart=1 - fi -- else -- super_ocf_log warn "ACT: sapstartsrv is not running for instance $SID-$InstanceName, it will be started now" -- restart=1 - fi -- fi -- if [ -z "$runninginst" ]; then runninginst=$InstanceName; fi -- if [ $restart -eq 1 ] -- then -- if [ -d /usr/sap/$SID/SYS/profile/ ] -+ if [ -z "$runninginst" ]; then runninginst=$InstanceName; fi -+ if [ $restart -eq 1 ] - then -- DIR_PROFILE="/usr/sap/$SID/SYS/profile" -- else -- assert "Expected /usr/sap/$SID/SYS/profile/ to be a directory, please set DIR_PROFILE parameter!" -- fi -- [ ! -r $SAPSTARTPROFILE ] && assert "Expected $SAPSTARTPROFILE to be the instance START profile, please set INSTANCE_PROFILE parameter!" -- pkill -9 -f "sapstartsrv.*$runninginst" -- # removing the unix domain socket files as they might have wrong permissions -- # or ownership - they will be recreated by sapstartsrv during next start -- rm -f /tmp/.sapstream5${InstanceNr}13 -- rm -f /tmp/.sapstream5${InstanceNr}14 -- ( -- export PATH="$DIR_EXECUTABLE${PATH:+:}$PATH" -- export LD_LIBRARY_PATH="$DIR_EXECUTABLE${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" -- $SAPSTARTSRV pf=$SAPSTARTPROFILE -D -u $sidadm -- ) -- # now make sure the daemon has been started and is able to respond -- local srvrc=1 -- while [ $srvrc -eq 1 -a $(pgrep -f "sapstartsrv.*$runninginst" | wc -l) -gt 0 ] -- do -- sleep 1 -- $SAPCONTROL -nr $InstanceNr -function GetProcessList > /dev/null 2>&1 -- srvrc=$? -- done -- if [ $srvrc -ne 1 ] -- then -- super_ocf_log info "ACT: sapstartsrv for instance $SID-$InstanceName was restarted!" -- rc=$OCF_SUCCESS -- else -- super_ocf_log error "ACT: sapstartsrv for instance $SID-$InstanceName could not be started!" -- rc=$OCF_ERR_GENERIC -- ocf_is_probe && rc=$OCF_NOT_RUNNING -+ if [ -d /usr/sap/$SID/SYS/profile/ ] -+ then -+ DIR_PROFILE="/usr/sap/$SID/SYS/profile" -+ else -+ assert "Expected /usr/sap/$SID/SYS/profile/ to be a directory, please set DIR_PROFILE parameter!" -+ fi -+ [ ! -r $SAPSTARTPROFILE ] && assert "Expected $SAPSTARTPROFILE to be the instance START profile, please set INSTANCE_PROFILE parameter!" -+ pkill -9 -f "sapstartsrv.*$runninginst" -+ # removing the unix domain socket files as they might have wrong permissions -+ # or ownership - they will be recreated by sapstartsrv during next start -+ rm -f /tmp/.sapstream5${InstanceNr}13 -+ rm -f /tmp/.sapstream5${InstanceNr}14 -+ ( -+ export PATH="$DIR_EXECUTABLE${PATH:+:}$PATH" -+ export LD_LIBRARY_PATH="$DIR_EXECUTABLE${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" -+ $SAPSTARTSRV pf=$SAPSTARTPROFILE -D -u $sidadm -+ ) -+ # now make sure the daemon has been started and is able to respond -+ local srvrc=1 -+ while [ $srvrc -eq 1 -a $(pgrep -f "sapstartsrv.*$runninginst" | wc -l) -gt 0 ] -+ do -+ sleep 1 -+ $SAPCONTROL -nr $InstanceNr -function GetProcessList > /dev/null 2>&1 -+ srvrc=$? -+ done -+ if [ $srvrc -ne 1 ] -+ then -+ super_ocf_log info "ACT: sapstartsrv for instance $SID-$InstanceName was restarted!" -+ rc=$OCF_SUCCESS -+ else -+ super_ocf_log error "ACT: sapstartsrv for instance $SID-$InstanceName could not be started!" -+ rc=$OCF_ERR_GENERIC -+ ocf_is_probe && rc=$OCF_NOT_RUNNING -+ fi - fi - fi - return $rc -diff --git a/heartbeat/SAPHanaTopology b/heartbeat/SAPHanaTopology -index 29819d7..8dd133e 100755 ---- a/heartbeat/SAPHanaTopology -+++ b/heartbeat/SAPHanaTopology -@@ -14,7 +14,7 @@ - # License: GNU General Public License (GPL) - # Copyright: (c) 2014 SUSE Linux Products GmbH - # (c) 2015-2018 SUSE Linux GmbH --# (c) 2019 SUSE LLC -+# (c) 2019-2021 SUSE LLC - # - # An example usage: - # See usage() function below for more details... -@@ -27,7 +27,7 @@ - # - ####################################################################### - # DONE PRIO 1: AFTER(!) SAP HANA SPS12 is available we could use hdbnsutil --sr_stateConfiguration --SAPHanaTopologyVersion="0.154.0" -+SAPHanaTopologyVersion="0.155.0" - # - # Initialization: - timeB=$(date '+%s') -@@ -458,6 +458,8 @@ function sht_init() { - local siteID - local siteNAME - local chkMethod="" -+ SYSTEMCTL="/usr/bin/systemctl" -+ systemd_unit_name="saphostagent.service" - HOSTEXECNAME=saphostexec - USRSAP=/usr/sap - SAPSERVICE_PATH=${USRSAP}/sapservices -@@ -662,6 +664,24 @@ function check_for_primary() { - return $rc - } - -+# chk4systemdsupport - check, if SAP systemd support is available -+# check for the existence of the SAP Host Agent related unit file -+# rc=0 - SAP Host Agent unit file exists -+# rc=1 - SAP Host Agent unit file does NOT exist -+function chk4systemdsupport() { -+ super_ocf_log info "FLOW ${FUNCNAME[0]}" -+ local rc=1 -+ if [ -x "$SYSTEMCTL" ]; then -+ if [ -f /etc/systemd/system/"$systemd_unit_name" ]; then -+ rc=0 -+ elif $SYSTEMCTL list-unit-files "$systemd_unit_name"; then -+ rc=0 -+ else -+ rc=1 -+ fi -+ fi -+ return $rc -+} - - # - # function: start_saphostagent -@@ -671,8 +691,19 @@ function check_for_primary() { - function start_saphostagent() - { - ### SAP-CALL -- if [ -x "${HOSTEXEC_PATH}" ]; then -- ${HOSTEXEC_PATH} pf=${HOSTEXEC_PROFILE_PATH} -+ if chk4systemdsupport; then -+ # use systemd to control saphostagent -+ if $SYSTEMCTL is-active --quiet "$systemd_unit_name"; then -+ super_ocf_log info "ACT: systemd service $systemd_unit_name is active" -+ else -+ super_ocf_log warn "ACT: systemd service $systemd_unit_name is not active, it will be started using systemd" -+ $SYSTEMCTL start "$systemd_unit_name" >/dev/null 2>&1 -+ fi -+ else -+ # no SAP systemd unit available, continue with old code... -+ if [ -x "${HOSTEXEC_PATH}" ]; then -+ ${HOSTEXEC_PATH} pf=${HOSTEXEC_PROFILE_PATH} -+ fi - fi - return 0 - } -@@ -685,8 +716,19 @@ function start_saphostagent() - function stop_saphostagent() - { - ### SAP-CALL -- if [ -x "${HOSTEXEC_PATH}" ]; then -- ${HOSTEXEC_PATH} -stop -+ if chk4systemdsupport; then -+ # use systemd to control saphostagent -+ if $SYSTEMCTL is-active --quiet "$systemd_unit_name"; then -+ super_ocf_log warn "ACT: systemd service $systemd_unit_name is active, now stopping using systemd" -+ $SYSTEMCTL stop "$systemd_unit_name" >/dev/null 2>&1 -+ else -+ super_ocf_log info "ACT: systemd service $systemd_unit_name is not active" -+ fi -+ else -+ # no SAP systemd unit available, continue with old code... -+ if [ -x "${HOSTEXEC_PATH}" ]; then -+ ${HOSTEXEC_PATH} -stop -+ fi - fi - } - -@@ -698,9 +740,20 @@ function stop_saphostagent() - function check_saphostagent() - { - local rc=1 -- # TODO: PRIO3: should the path been removed like "saphostexec" instead of "/usr/sap/hostctrl/exe/saphostexec" -- # or should we use ${HOSTEXEC_PATH} instead? -- pgrep -f /usr/sap/hostctrl/exe/saphostexec; rc=$? -+ if chk4systemdsupport; then -+ # use systemd to control saphostagent -+ if $SYSTEMCTL is-active --quiet "$systemd_unit_name"; then -+ super_ocf_log warn "ACT: systemd service $systemd_unit_name is active" -+ rc=0 -+ else -+ super_ocf_log info "ACT: systemd service $systemd_unit_name is not active" -+ fi -+ else -+ # no SAP systemd unit available, continue with old code... -+ # TODO: PRIO3: should the path been removed like "saphostexec" instead of "/usr/sap/hostctrl/exe/saphostexec" -+ # or should we use ${HOSTEXEC_PATH} instead? -+ pgrep -f /usr/sap/hostctrl/exe/saphostexec; rc=$? -+ fi - return $rc - } - diff --git a/SOURCES/bz2026273-2-SAPHana-SAPHanaTopology-suppress-systemctl-output.patch b/SOURCES/bz2026273-2-SAPHana-SAPHanaTopology-suppress-systemctl-output.patch deleted file mode 100644 index 69dcd76..0000000 --- a/SOURCES/bz2026273-2-SAPHana-SAPHanaTopology-suppress-systemctl-output.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 28658d187bbfdcb6a7c570f327c20be4ae253794 Mon Sep 17 00:00:00 2001 -From: AngelaBriel -Date: Thu, 25 Nov 2021 15:17:10 +0100 -Subject: [PATCH] supress output of comman 'systemctl list-unit-files' - ---- - heartbeat/SAPHana | 2 +- - heartbeat/SAPHanaTopology | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana -index aaff777..3569b3d 100755 ---- a/heartbeat/SAPHana -+++ b/heartbeat/SAPHana -@@ -956,7 +956,7 @@ function chk4systemdsupport() { - if [ -x "$SYSTEMCTL" ]; then - if [ -f /etc/systemd/system/"$systemd_unit_name" ]; then - rc=0 -- elif $SYSTEMCTL list-unit-files "$systemd_unit_name"; then -+ elif $SYSTEMCTL list-unit-files "$systemd_unit_name" >/dev/null 2>&1; then - rc=0 - else - rc=1 -diff --git a/heartbeat/SAPHanaTopology b/heartbeat/SAPHanaTopology -index 8dd133e..74f3e72 100755 ---- a/heartbeat/SAPHanaTopology -+++ b/heartbeat/SAPHanaTopology -@@ -674,7 +674,7 @@ function chk4systemdsupport() { - if [ -x "$SYSTEMCTL" ]; then - if [ -f /etc/systemd/system/"$systemd_unit_name" ]; then - rc=0 -- elif $SYSTEMCTL list-unit-files "$systemd_unit_name"; then -+ elif $SYSTEMCTL list-unit-files "$systemd_unit_name" >/dev/null 2>&1; then - rc=0 - else - rc=1 diff --git a/SOURCES/bz2026273-3-SAPHana-SAPHanaTopology-fix-unit-test-issue.patch b/SOURCES/bz2026273-3-SAPHana-SAPHanaTopology-fix-unit-test-issue.patch deleted file mode 100644 index 975c302..0000000 --- a/SOURCES/bz2026273-3-SAPHana-SAPHanaTopology-fix-unit-test-issue.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 65a7f2b88f674b680160b8015cd1ee1ad61b6293 Mon Sep 17 00:00:00 2001 -From: AngelaBriel -Date: Mon, 20 Dec 2021 10:23:24 +0100 -Subject: [PATCH] The return value of 'systemctl list-unit-files ' is - not reliable on all SLE15 codestreams, so it is not usable for our resource - agents. We need to go back to parsing the command output instead and hoping, - that the output format will not change in the future, because that will - breake the solution again as well. - ---- - heartbeat/SAPHana | 3 ++- - heartbeat/SAPHanaTopology | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana -index 3569b3d..ed1ca00 100755 ---- a/heartbeat/SAPHana -+++ b/heartbeat/SAPHana -@@ -956,7 +956,8 @@ function chk4systemdsupport() { - if [ -x "$SYSTEMCTL" ]; then - if [ -f /etc/systemd/system/"$systemd_unit_name" ]; then - rc=0 -- elif $SYSTEMCTL list-unit-files "$systemd_unit_name" >/dev/null 2>&1; then -+ elif $SYSTEMCTL list-unit-files | \ -+ awk '$1 == service { found=1 } END { if (! found) {exit 1}}' service="${systemd_unit_name}.service"; then - rc=0 - else - rc=1 -diff --git a/heartbeat/SAPHanaTopology b/heartbeat/SAPHanaTopology -index 74f3e72..f5dcb30 100755 ---- a/heartbeat/SAPHanaTopology -+++ b/heartbeat/SAPHanaTopology -@@ -674,7 +674,8 @@ function chk4systemdsupport() { - if [ -x "$SYSTEMCTL" ]; then - if [ -f /etc/systemd/system/"$systemd_unit_name" ]; then - rc=0 -- elif $SYSTEMCTL list-unit-files "$systemd_unit_name" >/dev/null 2>&1; then -+ elif $SYSTEMCTL list-unit-files | \ -+ awk '$1 == service { found=1 } END { if (! found) {exit 1}}' service="${systemd_unit_name}.service"; then - rc=0 - else - rc=1 diff --git a/SOURCES/bz2026727-1-SAPHana-remove-HANA_CALL_TIMEOUT-parameter.patch b/SOURCES/bz2026727-1-SAPHana-remove-HANA_CALL_TIMEOUT-parameter.patch deleted file mode 100644 index 80a8cbb..0000000 --- a/SOURCES/bz2026727-1-SAPHana-remove-HANA_CALL_TIMEOUT-parameter.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 621c6cc4ca494834f921671a4540b7063a33648e Mon Sep 17 00:00:00 2001 -From: Frank Danapfel -Date: Fri, 12 Nov 2021 11:35:15 +0100 -Subject: [PATCH] SAPHana: remove info about HANA_CALL_TIMEOUT parameter - -It doesn't make sense to have HANA_CALL_TIMEOUT listed as a parameter since it is hardcoded to 60s and therefore can't be changed. ---- - heartbeat/SAPHana | 9 --------- - 1 file changed, 9 deletions(-) - -diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana -index cd91ddf..5da587d 100755 ---- a/heartbeat/SAPHana -+++ b/heartbeat/SAPHana -@@ -242,15 +242,6 @@ The resource agent uses the following four interfaces provided by SAP: - - - -- -- Define timeout how long a call to HANA to receive information can take. -- Define timeout how long a call to HANA to receive information can take. This could be eg landscapeHostConfiguration.py. -- There are some specific calls to HANA which have their own timeout values. For example the takeover command does not timeout (inf). -- If the timeout is reached, the return code will be 124. If you increase the timeouts for HANA calls you should also adjust the operation timeouts -- of your cluster resources. -- -- -- - - The full qualified path where to find sapstartsrv and sapcontrol. Specify this parameter, if you have changed the SAP kernel directory location after the default SAP installation. - Path of sapstartsrv and sapcontrol diff --git a/SOURCES/bz2026727-2-SAPHanaTopology-remove-HANA_CALL_TIMEOUT-parameter.patch b/SOURCES/bz2026727-2-SAPHanaTopology-remove-HANA_CALL_TIMEOUT-parameter.patch deleted file mode 100644 index e8da0c9..0000000 --- a/SOURCES/bz2026727-2-SAPHanaTopology-remove-HANA_CALL_TIMEOUT-parameter.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 91a6a7fca636972a9604675a99946e8a8e51fd73 Mon Sep 17 00:00:00 2001 -From: Frank Danapfel -Date: Fri, 12 Nov 2021 11:36:33 +0100 -Subject: [PATCH] SAPHanaTopology: Remove info about HANA_CALL_TIMEOUT - -It doesn't make sense to have HANA_CALL_TIMEOUT listed as a parameter since it is hardcoded to 60s and therefore can't be changed. ---- - heartbeat/SAPHanaTopology | 9 --------- - 1 file changed, 9 deletions(-) - -diff --git a/heartbeat/SAPHanaTopology b/heartbeat/SAPHanaTopology -index afc645c..29819d7 100755 ---- a/heartbeat/SAPHanaTopology -+++ b/heartbeat/SAPHanaTopology -@@ -173,15 +173,6 @@ SAPHanaTopology scans the output table of landscapeHostConfiguration.py to ident - The SAP Instance Number - - -- -- Define timeout how long a call to HANA to receive information can take. -- Define timeout how long a call to HANA to receive information can take. This could be eg landscapeHostConfiguration.py. -- There are some specific calls to HANA which have their own timeout values. For example the takeover command does not timeout (inf). -- If the timeout is reached, the return code will be 124. If you increase the timeouts for HANA calls you should also adjust the operation timeouts -- of your cluster resources. -- -- -- - - Path to the SAP Hana Instance executable directory. If not set the RA tries /usr/sap/\$SID/\$InstanceName/exe. - While InstanceName is the string of "HDB" and \$InstanceNumber for SAP Hana databases. diff --git a/SOURCES/bz2050205-SAPHana-SAPHanaTopology-fix-metadata-version.patch b/SOURCES/bz2050205-SAPHana-SAPHanaTopology-fix-metadata-version.patch deleted file mode 100644 index f09a53e..0000000 --- a/SOURCES/bz2050205-SAPHana-SAPHanaTopology-fix-metadata-version.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 182dbd793e9c6ce0e5a0abc7d595a864175248bb Mon Sep 17 00:00:00 2001 -From: Oyvind Albrigtsen -Date: Thu, 20 Jan 2022 10:41:51 +0100 -Subject: [PATCH] SAPHana*: follow OCF standard for version and OCF version in - metadata - ---- - heartbeat/SAPHana | 4 ++-- - heartbeat/SAPHanaTopology | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana -index 295eff0..6527362 100755 ---- a/heartbeat/SAPHana -+++ b/heartbeat/SAPHana -@@ -160,8 +160,8 @@ function saphana_meta_data() { - cat < - -- --$SAPHanaVersion -+ -+1.0 - - Manages two SAP HANA database systems in system replication (SR). - -diff --git a/heartbeat/SAPHanaTopology b/heartbeat/SAPHanaTopology -index 3fce400..9ad2101 100755 ---- a/heartbeat/SAPHanaTopology -+++ b/heartbeat/SAPHanaTopology -@@ -134,8 +134,8 @@ function sht_meta_data() { - cat < - -- -- $SAPHanaTopologyVersion -+ -+ 1.0 - Analyzes SAP HANA System Replication Topology. - This RA analyzes the SAP HANA topology and "sends" all findings via the node status attributes to - all nodes in the cluster. These attributes are taken by the SAPHana RA to control the SAP Hana Databases. diff --git a/SPECS/resource-agents-sap-hana.spec b/SPECS/resource-agents-sap-hana.spec index 01ec25f..180e790 100644 --- a/SPECS/resource-agents-sap-hana.spec +++ b/SPECS/resource-agents-sap-hana.spec @@ -23,13 +23,13 @@ %global upstream_version e711383f %global saphana_prefix SAPHanaSR -%global saphana_version d1dde99 +%global saphana_version 6281418 Name: resource-agents-sap-hana Summary: SAP HANA cluster resource agents Epoch: 1 -Version: 0.154.0 -Release: 7%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Version: 0.162.1 +Release: 2%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ URL: https://github.com/SUSE/SAPHanaSR %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -39,13 +39,6 @@ Group: Productivity/Clustering/HA %endif Source0: %{upstream_prefix}-%{upstream_version}.tar.gz Source1: %{saphana_prefix}-%{saphana_version}.tar.gz -Patch0: bz1855885-SAPHana-use-actual-mode.patch -Patch1: bz2026727-1-SAPHana-remove-HANA_CALL_TIMEOUT-parameter.patch -Patch2: bz2026727-2-SAPHanaTopology-remove-HANA_CALL_TIMEOUT-parameter.patch -Patch3: bz2026273-1-SAPHana-SAPHanaTopology-add-systemd-support.patch -Patch4: bz2026273-2-SAPHana-SAPHanaTopology-suppress-systemctl-output.patch -Patch5: bz2026273-3-SAPHana-SAPHanaTopology-fix-unit-test-issue.patch -Patch6: bz2050205-SAPHana-SAPHanaTopology-fix-metadata-version.patch BuildArch: noarch @@ -79,13 +72,7 @@ sed -i -e '/ ocf_heartbeat_SAPInstance.7 \\/a\ # change provider company sed -i -e 's/\("provider_company": \)"SUSE"/\1"Red Hat"/g' %{saphana_prefix}-%{saphana_version}/srHook/SAPHanaSR.py -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 +#%patch0 -p1 %build if [ ! -f configure ]; then @@ -115,8 +102,9 @@ make install DESTDIR=%{buildroot} find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAPHana*" -exec rm {} \; find %{buildroot}/%{_mandir} -type f ! -iname "*SAPHana*" -exec rm {} \; -mkdir %{buildroot}/%{_datadir}/SAPHanaSR -cp -r %{saphana_prefix}-%{saphana_version}/srHook %{buildroot}/%{_datadir}/SAPHanaSR +mkdir -p %{buildroot}/%{_datadir}/SAPHanaSR/srHook +cp -r %{saphana_prefix}-%{saphana_version}/srHook/global.ini %{buildroot}/%{_datadir}/SAPHanaSR/srHook +cp -r %{saphana_prefix}-%{saphana_version}/srHook/SAPHanaSR.py %{buildroot}/%{_datadir}/SAPHanaSR/srHook ## tree fixup # remove docs (there is only one and they should come from doc sections in files) @@ -142,6 +130,11 @@ rm -rf %{buildroot} %exclude /usr/src %changelog +* Mon Mar 20 2023 Janine Fuchs - 0.162.1-2 +- Rebase to SAPHanaSR 0.162.1 upstream release. + + Resolves: rhbz#2165668 + * Thu Feb 3 2022 Oyvind Albrigtsen - 0.154.0-7 - SAPHana/SAPHanaTopology: follow OCF standard for version and OCF version in metadata