Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

11 changed files with 91 additions and 506 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz
SOURCES/ClusterLabs-resource-agents-fd0720f7.tar.gz
SOURCES/sap_cluster_connector-0015fe2.tar.gz

View File

@ -1,2 +1,2 @@
0358e1cb7fe86b2105bd2646cbe86f3c0273844a SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz
3b517ecdbe2103df77813050e5c998e102c5de7e SOURCES/ClusterLabs-resource-agents-fd0720f7.tar.gz
731c683ecc63b50fbc0823170e966b74ec2a0f51 SOURCES/sap_cluster_connector-0015fe2.tar.gz

View File

@ -1,92 +0,0 @@
From 70a28e8130be863a9073b0a80e0511e971e205c4 Mon Sep 17 00:00:00 2001
From: Fabian Herschel <fabian.herschel@suse.com>
Date: Fri, 27 Jul 2018 12:33:19 +0200
Subject: [PATCH 1/2] SAPInstance: implemeted reload method The reload method
is needed to avoid resource restarts after a non-unique parameter has been
changed. This is in special for interest of the MONITOR_SERVICES parameter.
---
heartbeat/SAPInstance | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
index 8de7cee8c..c25839f0c 100755
--- a/heartbeat/SAPInstance
+++ b/heartbeat/SAPInstance
@@ -61,6 +61,7 @@ sapinstance_usage() {
The 'monitor' operation reports whether the instance seems to be working
The 'promote' operation starts the primary instance in a Master/Slave configuration
The 'demote' operation stops the primary instance and starts the ERS instance
+ The 'reload' operation allows changed parameters (non-unique only) without restarting the service
The 'notify' operation always returns SUCCESS
The 'validate-all' operation reports whether the parameters are valid
The 'methods' operation reports on the methods $0 supports
@@ -224,6 +225,7 @@ The name of the SAP START profile. Specify this parameter, if you have changed t
<action name="monitor" depth="0" timeout="60s" interval="119s" role="Master" />
<action name="promote" timeout="320s" />
<action name="demote" timeout="320s" />
+<action name="reload" timeout="320" />
<action name="validate-all" timeout="5s" />
<action name="meta-data" timeout="5s" />
<action name="methods" timeout="5s" />
@@ -244,6 +246,7 @@ sapinstance_methods() {
monitor
promote
demote
+ reload
notify
validate-all
methods
@@ -965,6 +968,9 @@ case "$ACTION" in
exit $?;;
validate-all) sapinstance_validate
exit $?;;
+ reload )
+ ocf_log info "reloading SAPInstance parameters"
+ exit $OCF_SUCCESS;;
*) sapinstance_methods
exit $OCF_ERR_UNIMPLEMENTED;;
esac
From ee529b088cc1111656e94dea56b9fcfa6d813313 Mon Sep 17 00:00:00 2001
From: Fabian Herschel <fabian.herschel@suse.com>
Date: Fri, 27 Jul 2018 13:02:39 +0200
Subject: [PATCH 2/2] SAPInstance: Improved indents
---
heartbeat/SAPInstance | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
index c25839f0c..174ea36ef 100755
--- a/heartbeat/SAPInstance
+++ b/heartbeat/SAPInstance
@@ -61,7 +61,7 @@ sapinstance_usage() {
The 'monitor' operation reports whether the instance seems to be working
The 'promote' operation starts the primary instance in a Master/Slave configuration
The 'demote' operation stops the primary instance and starts the ERS instance
- The 'reload' operation allows changed parameters (non-unique only) without restarting the service
+ The 'reload' operation allows changed parameters (non-unique only) without restarting the service
The 'notify' operation always returns SUCCESS
The 'validate-all' operation reports whether the parameters are valid
The 'methods' operation reports on the methods $0 supports
@@ -246,7 +246,7 @@ sapinstance_methods() {
monitor
promote
demote
- reload
+ reload
notify
validate-all
methods
@@ -969,8 +969,8 @@ case "$ACTION" in
validate-all) sapinstance_validate
exit $?;;
reload )
- ocf_log info "reloading SAPInstance parameters"
- exit $OCF_SUCCESS;;
+ ocf_log info "reloading SAPInstance parameters"
+ exit $OCF_SUCCESS;;
*) sapinstance_methods
exit $OCF_ERR_UNIMPLEMENTED;;
esac

View File

@ -1,26 +0,0 @@
From 8eda4725a946ca669df035ed0ffdf053a65e1258 Mon Sep 17 00:00:00 2001
From: Fabian Herschel <fabian.herschel@suse.com>
Date: Thu, 2 Aug 2018 15:36:31 +0200
Subject: [PATCH] SAPInstance: Improved SAP instance profile detection
---
heartbeat/SAPInstance | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
index 174ea36ef..eb058cccf 100755
--- a/heartbeat/SAPInstance
+++ b/heartbeat/SAPInstance
@@ -371,7 +371,11 @@ sapinstance_init() {
if [ -z "$currentSTART_PROFILE" ]
then
- SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
+ if [ ! -r "$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}" -a -r "$DIR_PROFILE/${SID}_${InstanceName}_${SAPVIRHOST}" ]; then
+ SAPSTARTPROFILE="$DIR_PROFILE/${SID}_${InstanceName}_${SAPVIRHOST}"
+ else
+ SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
+ fi
else
SAPSTARTPROFILE="$currentSTART_PROFILE"
fi

View File

@ -1,37 +0,0 @@
--- a/heartbeat/SAPInstance 2019-02-20 12:42:55.655819263 +0100
+++ b/heartbeat/SAPInstance 2019-02-08 10:57:02.281048136 +0100
@@ -159,14 +159,14 @@
<content type="string" default="disp+work|msg_server|enserver|enrepserver|jcontrol|jstart|enq_server|enq_replicator"/>
</parameter>
<parameter name="SHUTDOWN_METHOD" unique="0" required="0">
- <longdesc lang="en">Usual a SAP Instance is stopped by the command 'sapcontrol -nr InstanceNr -function Stop'. SHUTDOWN_METHOD=KILL means to kill the SAP Instance using OS commands. SAP processes of the instance are terminated with 'kill -9', shared memory is deleted with 'cleanipc' and the 'kill.sap' file will be deleted. That method is much faster than the gracefull stop, but the instance does not have the chance to say goodbye to other SAPinstances in the same system. USE AT YOUR OWN RISK !!</longdesc>
+ <longdesc lang="en">Usually a SAP Instance is stopped by the command 'sapcontrol -nr InstanceNr -function Stop'. SHUTDOWN_METHOD=KILL means to kill the SAP Instance using OS commands. SAP processes of the instance are terminated with 'kill -9', shared memory is deleted with 'cleanipc' and the 'kill.sap' file will be deleted. That method is much faster than the graceful stop, but the instance does not have the chance to say goodbye to other SAPinstances in the same system. USE AT YOUR OWN RISK !!</longdesc>
<shortdesc lang="en">Shutdown graceful or kill a SAP instance by terminating the processes. (normal|KILL)</shortdesc>
<content type="string" default="normal"/>
</parameter>
<parameter name="ERS_InstanceName" unique="1" required="0">
<longdesc lang="en">Only used in a Master/Slave resource configuration:
The full qualified SAP enqueue replication instance name. e.g. P01_ERS02_sapp01ers. Usually this is the name of the SAP instance profile.
-The enqueue replication instance must be installed, before you want to configure a master-slave cluster recource.
+The enqueue replication instance must be installed, before you want to configure a master-slave cluster resource.
The master-slave configuration in the cluster must use this properties:
clone_max = 2
@@ -209,7 +209,7 @@
<longdesc lang="en">Only used for ASCS/ERS SAP Netweaver installations without implementing a master/slave resource to
allow the ASCS to 'find' the ERS running on another cluster node after a resource failure. This parameter should be set
to true 'only' for the ERS instance for implementations following the SAP NetWeaver 7.40 HA certification (NW-HA-CLU-740). This includes also
- systems for NetWeaver less than 7.40, if you like to impelemnt the NW-HA-CLU-740 scenario.
+ systems for NetWeaver less than 7.40, if you like to implement the NW-HA-CLU-740 scenario.
</longdesc>
<shortdesc lang="en">Mark SAPInstance as ERS instance</shortdesc>
<content type="boolean" default="false" />
@@ -225,7 +225,7 @@
<action name="monitor" depth="0" timeout="60s" interval="119s" role="Master" />
<action name="promote" timeout="320s" />
<action name="demote" timeout="320s" />
-<action name="reload" timeout="320" />
+<action name="reload" timeout="320s" />
<action name="validate-all" timeout="5s" />
<action name="meta-data" timeout="5s" />
<action name="methods" timeout="5s" />

View File

@ -1,44 +0,0 @@
diff -uNr a/heartbeat/ClusterMon b/heartbeat/ClusterMon
--- a/heartbeat/ClusterMon 2018-06-29 14:05:02.000000000 +0200
+++ b/heartbeat/ClusterMon 2020-03-27 12:09:23.636845893 +0100
@@ -86,7 +86,7 @@
PID file location to ensure only one instance is running
</longdesc>
<shortdesc lang="en">PID file</shortdesc>
-<content type="string" default="/tmp/ClusterMon_${OCF_RESOURCE_INSTANCE}.pid" />
+<content type="string" default="${HA_RSCTMP}/ClusterMon_${OCF_RESOURCE_INSTANCE}.pid" />
</parameter>
<parameter name="htmlfile" unique="1" required="0">
@@ -94,7 +94,7 @@
Location to write HTML output to.
</longdesc>
<shortdesc lang="en">HTML output</shortdesc>
-<content type="string" default="/tmp/ClusterMon_${OCF_RESOURCE_INSTANCE}.html" />
+<content type="string" default="${HA_RSCTMP}/ClusterMon_${OCF_RESOURCE_INSTANCE}.html" />
</parameter>
</parameters>
@@ -233,8 +233,8 @@
fi
: ${OCF_RESKEY_update:="15000"}
-: ${OCF_RESKEY_pidfile:="/tmp/ClusterMon_${OCF_RESOURCE_INSTANCE}.pid"}
-: ${OCF_RESKEY_htmlfile:="/tmp/ClusterMon_${OCF_RESOURCE_INSTANCE}.html"}
+: ${OCF_RESKEY_pidfile:="${HA_RSCTMP}/ClusterMon_${OCF_RESOURCE_INSTANCE}.pid"}
+: ${OCF_RESKEY_htmlfile:="${HA_RSCTMP}/ClusterMon_${OCF_RESOURCE_INSTANCE}.html"}
OCF_RESKEY_update=`expr $OCF_RESKEY_update / 1000`
diff -uNr a/heartbeat/sapdb-nosha.sh b/heartbeat/sapdb-nosha.sh
--- a/heartbeat/sapdb-nosha.sh 2018-06-29 14:05:02.000000000 +0200
+++ b/heartbeat/sapdb-nosha.sh 2020-03-27 12:07:16.183958164 +0100
@@ -740,5 +740,5 @@
}
# Set a tempfile and make sure to clean it up again
-TEMPFILE="/tmp/SAPDatabase.$$.tmp"
-trap trap_handler INT TERM
\ No newline at end of file
+TEMPFILE="${HA_RSCTMP}/SAPDatabase.$$.tmp"
+trap trap_handler INT TERM

View File

@ -1,41 +0,0 @@
From d6b954890b496fcdd8a76d7c2dd44a36fa0ad42c Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 7 Oct 2021 11:10:16 +0200
Subject: [PATCH 1/3] all agents: specify agent and OCF versions corrently in
metadata
---
heartbeat/SAPDatabase | 4 ++--
heartbeat/SAPInstance | 4 ++--
133 files changed, 169 insertions(+), 169 deletions(-)
diff --git a/heartbeat/SAPDatabase b/heartbeat/SAPDatabase
index 3486303f10..563a6f3469 100755
--- a/heartbeat/SAPDatabase
+++ b/heartbeat/SAPDatabase
@@ -109,8 +109,8 @@ meta_data() {
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="SAPDatabase">
-<version>2.14</version>
+<resource-agent name="SAPDatabase" version="2.14">
+<version>1.0</version>
<longdesc lang="en">
Resource script for SAP databases. It manages a SAP database of any type as an HA resource.
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
index f8bcbc05b8..016f59aff2 100755
--- a/heartbeat/SAPInstance
+++ b/heartbeat/SAPInstance
@@ -110,8 +110,8 @@ sapinstance_meta_data() {
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="SAPInstance">
-<version>2.14</version>
+<resource-agent name="SAPInstance" version="2.14">
+<version>1.0</version>
<longdesc lang="en">
Usually a SAP system consists of one database and at least one or more SAP instances (sometimes called application servers). One SAP Instance is defined by having exactly one instance profile. The instance profiles can usually be found in the directory /sapmnt/SID/profile. Each instance must be configured as it's own resource in the cluster configuration.

View File

@ -1,196 +0,0 @@
From 2d50c76c366df4e6021c2992e085bbc48fa112b0 Mon Sep 17 00:00:00 2001
From: fmherschel <fh-github@herschel-mainz.org>
Date: Fri, 25 Jun 2021 16:16:51 +0200
Subject: [PATCH] SAPInstance: add systemd compatability (#1662)
* SAPInstance: for systemd integrated sapstartsrv instances use systemd to check/start the service
---
heartbeat/SAPInstance | 146 ++++++++++++++++++++++++++----------------
1 file changed, 91 insertions(+), 55 deletions(-)
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
index 8c404d4376..15b24024e0 100755
--- a/heartbeat/SAPInstance
+++ b/heartbeat/SAPInstance
@@ -369,6 +369,7 @@ sapinstance_init() {
InstanceName=`echo "$myInstanceName" | cut -d_ -f2`
InstanceNr=`echo "$InstanceName" | sed 's/.*\([0-9][0-9]\)$/\1/'`
SAPVIRHOST=`echo "$myInstanceName" | cut -d_ -f3`
+ SYSTEMCTL="systemctl"
# optional OCF parameters, we try to guess which directories are correct
if [ -z "$OCF_RESKEY_DIR_EXECUTABLE" ]
@@ -446,6 +447,25 @@ sapinstance_init() {
return $OCF_SUCCESS
}
+#
+# check_systemd_integration : Check, if SAP instance is controlled by systemd unit file SAP<SID>_<InstanceNr>.service
+# rc == 0 : sap instance is controlled by the unit file (file at least exists)
+# rc == 1 : sap instance is NOT controlled by the unit file (file does not exist)
+#
+check_systemd_integration() {
+ local systemd_unit_name="SAP${SID}_${InstanceNr}"
+ local rc=1
+
+ if [ -x "$SYSTEMCTL" ]; then
+ if $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
+ fi
+ fi
+ return "$rc"
+}
#
# check_sapstartsrv : Before using sapcontrol we make sure that the sapstartsrv is running for the correct instance.
@@ -458,76 +478,92 @@ check_sapstartsrv() {
local chkrc=$OCF_SUCCESS
local output=""
- if [ ! -S /tmp/.sapstream5${InstanceNr}13 ]; then
- ocf_log warn "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
- runninginst=`echo "$output" | grep '^0 : ' | cut -d' ' -f3`
- if [ "$runninginst" != "$InstanceName" ]
- then
- ocf_log warn "sapstartsrv is running for instance $runninginst, that service will be killed"
+ # check for sapstartsrv/systemd integration
+
+ if check_systemd_integration; then
+ # do it the systemd way
+ local systemd_unit_name="SAP${SID}_${InstanceNr}"
+
+ if $SYSTEMCTL status "$systemd_unit_name" 1>/dev/null 2>/dev/null; then
+ ocf_log info "systemd service $systemd_unit_name is active"
+ else
+ ocf_log warn "systemd service $systemd_unit_name is not active, it will be started using systemd"
+ $SYSTEMCTL start "$systemd_unit_name" 1>/dev/null 2>/dev/null
+ # use start, because restart does also stop sap instance
+ fi
+
+ return 0
+ else # otherwise continue with old code...
+ if [ ! -S /tmp/.sapstream5${InstanceNr}13 ]; then
+ ocf_log warn "sapstartsrv is not running for instance $SID-$InstanceName (no UDS), it will be started now"
restart=1
else
- output=`$SAPCONTROL -nr $InstanceNr -function AccessCheck Start`
- if [ $? -ne 0 ]; then
- ocf_log warn "FAILED : sapcontrol -nr $InstanceNr -function AccessCheck Start (`ls -ld1 /tmp/.sapstream5${InstanceNr}13`)"
- ocf_log warn "sapstartsrv will be restarted to try to solve this situation, otherwise please check sapstsartsrv setup (SAP Note 927637)"
+ 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" ]
+ then
+ ocf_log warn "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
+ ocf_log warn "FAILED : sapcontrol -nr $InstanceNr -function AccessCheck Start (`ls -ld1 /tmp/.sapstream5${InstanceNr}13`)"
+ ocf_log warn "sapstartsrv will be restarted to try to solve this situation, otherwise please check sapstsartsrv setup (SAP Note 927637)"
+ restart=1
+ fi
+ fi
+ else
+ ocf_log warn "sapstartsrv is not running for instance $SID-$InstanceName, it will be started now"
restart=1
fi
fi
- else
- ocf_log warn "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 [ -z "$runninginst" ]; then runninginst=$InstanceName; fi
- if [ $restart -eq 1 ]
- then
+ if [ $restart -eq 1 ]
+ then
+ if [ -d /usr/sap/$SID/SYS/profile/ ]
+ then
+ DIR_PROFILE="/usr/sap/$SID/SYS/profile"
+ else
+ abnormal_end "Expected /usr/sap/$SID/SYS/profile/ to be a directory, please set DIR_PROFILE parameter!"
+ fi
- if [ -d /usr/sap/$SID/SYS/profile/ ]
- then
- DIR_PROFILE="/usr/sap/$SID/SYS/profile"
- else
- abnormal_end "Expected /usr/sap/$SID/SYS/profile/ to be a directory, please set DIR_PROFILE parameter!"
- fi
+ [ ! -r $SAPSTARTPROFILE ] && abnormal_end "Expected $SAPSTARTPROFILE to be the instance START profile, please set START_PROFILE parameter!"
- [ ! -r $SAPSTARTPROFILE ] && abnormal_end "Expected $SAPSTARTPROFILE to be the instance START profile, please set START_PROFILE parameter!"
+ pkill -9 -f "sapstartsrv.*$runninginst"
- 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
- # 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
+ $SAPSTARTSRV pf=$SAPSTARTPROFILE -D -u $sidadm
- $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
- # 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
+ ocf_log info "sapstartsrv for instance $SID-$InstanceName was restarted !"
+ chkrc=$OCF_SUCCESS
+ else
+ ocf_log error "sapstartsrv for instance $SID-$InstanceName could not be started!"
+ chkrc=$OCF_ERR_GENERIC
+ ocf_is_probe && chkrc=$OCF_NOT_RUNNING
+ fi
+ fi
- if [ $srvrc -ne 1 ]
- then
- ocf_log info "sapstartsrv for instance $SID-$InstanceName was restarted !"
- chkrc=$OCF_SUCCESS
- else
- ocf_log error "sapstartsrv for instance $SID-$InstanceName could not be started!"
- chkrc=$OCF_ERR_GENERIC
- ocf_is_probe && chkrc=$OCF_NOT_RUNNING
- fi
+ return $chkrc
fi
-
- return $chkrc
}

View File

@ -1,24 +0,0 @@
From 9a851525c30a4bdb522e64301268c9ef2188ae83 Mon Sep 17 00:00:00 2001
From: fmherschel <fh-github@herschel-mainz.org>
Date: Mon, 9 Aug 2021 11:57:22 +0200
Subject: [PATCH] SAPInstance: Fix for issue #1680 - SAPInstance fails to
detect systemd integration (#1681)
* SAPInstance: Fix for issue #1680 - SAPInstance fails to detect systemd integration
---
heartbeat/SAPInstance | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
index 15b24024e..f8bcbc05b 100755
--- a/heartbeat/SAPInstance
+++ b/heartbeat/SAPInstance
@@ -456,7 +456,7 @@ check_systemd_integration() {
local systemd_unit_name="SAP${SID}_${InstanceNr}"
local rc=1
- if [ -x "$SYSTEMCTL" ]; then
+ if which "$SYSTEMCTL" 1>/dev/null 2>/dev/null; then
if $SYSTEMCTL list-unit-files | \
awk '$1 == service { found=1 } END { if (! found) {exit 1}}' service="${systemd_unit_name}.service"; then
rc=0

View File

@ -20,46 +20,72 @@
#
%global upstream_prefix ClusterLabs-resource-agents
%global upstream_version e711383f
%global upstream_version fd0720f7
%global sap_script_prefix sap_cluster_connector
%global sap_script_hash 0015fe2
# Whether this platform defaults to using systemd as an init system
# (needs to be evaluated prior to BuildRequires being enumerated and
# installed as it's intended to conditionally select some of these, and
# for that there are only few indicators with varying reliability:
# - presence of systemd-defined macros (when building in a full-fledged
# environment, which is not the case with ordinary mock-based builds)
# - systemd-aware rpm as manifested with the presence of particular
# macro (rpm itself will trivially always be present when building)
# - existence of /usr/lib/os-release file, which is something heavily
# propagated by systemd project
# - when not good enough, there's always a possibility to check
# particular distro-specific macros (incl. version comparison)
%define systemd_native (%{?_unitdir:1}%{!?_unitdir:0}%{nil \
} || %{?__transaction_systemd_inhibit:1}%{!?__transaction_systemd_inhibit:0}%{nil \
} || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?))
# determine the ras-set to process based on configure invokation
%bcond_with rgmanager
%bcond_without linuxha
Name: resource-agents-sap
Summary: SAP cluster resource agents
Version: 4.1.1
Release: 34%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
Version: 4.10.0
Release: 3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+
URL: https://github.com/ClusterLabs/resource-agents
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
Group: System Environment/Base
%else
Group: Productivity/Clustering/HA
%endif
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
Source1: %{sap_script_prefix}-%{sap_script_hash}.tar.gz
Patch0: bz1751949-1-SAPInstance-add-reload-action.patch
Patch1: bz1751949-2-SAPInstance-improve-profile-detection.patch
Patch2: bz1751949-3-SAPInstance-metadata-improvements.patch
Patch3: bz1817439-use-safe-temp-file-location.patch
Patch4: bz2024140-SAPInstance-1-add-systemd-support.patch
Patch5: bz2024140-SAPInstance-2-fix-systemd-issue.patch
Patch6: bz1937026-SAPDatabase-SAPInstance-set-correct-agent-ocf-version.patch
Patch7: bz2151296-SAPInstance-improve-killsap-logic.patch
Patch0: bz2151293-SAPInstance-improve-killsap-logic.patch
BuildArch: noarch
BuildRequires: automake autoconf gcc
BuildRequires: perl-interpreter python3-devel
# Build dependencies
BuildRequires: make
BuildRequires: automake autoconf pkgconfig gcc
BuildRequires: libxslt glib2-devel
BuildRequires: systemd
BuildRequires: which
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
BuildRequires: docbook-style-xsl docbook-dtds
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
BuildRequires: python3-devel
%else
BuildRequires: python-devel
%endif
Requires: resource-agents >= 4.1.1
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
BuildRequires: docbook-style-xsl docbook-dtds
%if 0%{?rhel} == 0
BuildRequires: libnet-devel
%endif
%endif
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
%if 0%{?suse_version}
BuildRequires: libnet-devel
BuildRequires: libglue-devel
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
%endif
Requires: resource-agents >= 4.8.0
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
%description
The SAP resource agents interface with Pacemaker to allow
@ -69,23 +95,36 @@ SAP instances to be managed in a cluster environment.
%setup -q -n %{upstream_prefix}-%{upstream_version}
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%build
if [ ! -f configure ]; then
./autogen.sh
fi
%global rasset linux-ha
%if 0%{?fedora} >= 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
CFLAGS="$(echo '%{optflags}')"
%global conf_opt_fatal "--enable-fatal-warnings=no"
%else
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
%global conf_opt_fatal "--enable-fatal-warnings=yes"
%endif
%configure BASH_SHELL="/bin/bash" \
%if %{with rgmanager}
%global rasset rgmanager
%endif
%if %{with linuxha}
%global rasset linux-ha
%endif
%if %{with rgmanager} && %{with linuxha}
%global rasset all
%endif
export CFLAGS
%configure \
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
PYTHON="%{__python3}" \
%endif
%{conf_opt_fatal} \
%if %{defined _unitdir}
--with-systemdsystemunitdir=%{_unitdir} \
@ -94,7 +133,7 @@ fi
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
--with-rsctmpdir=/run/resource-agents \
%endif
--with-pkg-name=%{name} \
--with-pkg-name=resource-agents \
--with-ras-set=%{rasset}
%if %{defined jobs}
@ -106,6 +145,7 @@ JFLAGS="$(echo '%{_smp_mflags}')"
make $JFLAGS
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# remove other agents
@ -118,9 +158,6 @@ cp %{sap_script_prefix}-%{sap_script_hash}/redhat/sap_redhat_cluster_connector %
# remove docs (there is only one and they should come from doc sections in files)
rm -rf %{buildroot}/usr/share/doc/resource-agents
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_usr}/lib/ocf/resource.d/heartbeat/SAP*
@ -136,24 +173,32 @@ rm -rf %{buildroot}
%exclude /usr/libexec/heartbeat
%exclude /usr/sbin/ldirectord
%exclude /usr/sbin/ocf*
%exclude /usr/share/%{name}
%exclude /usr/share/resource-agents
%exclude /usr/share/pkgconfig/resource-agents.pc
%exclude /usr/src
%changelog
* Wed Dec 07 2022 Janine Fuchs <jfuchs@redhat.com> - 4.1.1-34
* Wed Dec 07 2022 Janine Fuchs <jfuchs@redhat.com> - 4.10.0-3
- SAPInstance: be more resilient against broken kill.sap files
Resolves: rhbz#2151296
Resolves: rhbz#2151293
* Fri Jun 17 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-32
- SAPDatabase/SAPInstance: set correct agent and OCF version in metadata
* Mon Nov 22 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-2
- Rebase to resource-agents 4.10.0 upstream release.
Resolves: rhbz#1937026
Resolves: rhbz#2024660
* Thu Nov 18 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-31
- SAPInstance: add systemd support
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 4.8.0-2.1
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
Resolves: rhbz#2024140
* Tue Jun 22 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.8.0-2
- Add CI gating tests
Resolves: rhbz#1960245
* Mon Jun 7 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.8.0-1
- Rebase to resource-agents 4.8.0 upstream release.
* Fri Apr 17 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-30
- use safe temp file location