Compare commits
No commits in common. "c8" and "c9-beta" have entirely different histories.
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz
|
SOURCES/ClusterLabs-resource-agents-a6ccb93a.tar.gz
|
||||||
SOURCES/sap_cluster_connector-0015fe2.tar.gz
|
SOURCES/SAPStartSrv-resourceAgent-1758e33.tar.gz
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
0358e1cb7fe86b2105bd2646cbe86f3c0273844a SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz
|
1b9dca55ed882a6353ac3fdf2cbbe572ff2a1618 SOURCES/ClusterLabs-resource-agents-a6ccb93a.tar.gz
|
||||||
731c683ecc63b50fbc0823170e966b74ec2a0f51 SOURCES/sap_cluster_connector-0015fe2.tar.gz
|
2cc07b55c836e0d7847fd52de89ed3d539281f7a SOURCES/SAPStartSrv-resourceAgent-1758e33.tar.gz
|
||||||
|
@ -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
|
|
@ -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
|
|
@ -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" />
|
|
@ -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
|
|
@ -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.
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -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
|
|
@ -1,46 +0,0 @@
|
|||||||
From 08ed464aa803f03cbb6cabc79afe462fc98ad213 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Fabian Herschel <fabian.herschel@suse.com>
|
|
||||||
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 <fabian.herschel@suse.com>
|
|
||||||
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
|
|
@ -12,54 +12,101 @@
|
|||||||
# Below is the script used to generate a new source file
|
# Below is the script used to generate a new source file
|
||||||
# from the resource-agent upstream git repo.
|
# from the resource-agent upstream git repo.
|
||||||
#
|
#
|
||||||
|
# Use a specified version as HEAD if needed, e.g. "v4.14.0"
|
||||||
|
#
|
||||||
|
# # Source0:
|
||||||
|
# git checkout <version tag>
|
||||||
# TAG=$(git log --pretty="format:%h" -n 1)
|
# TAG=$(git log --pretty="format:%h" -n 1)
|
||||||
# distdir="ClusterLabs-resource-agents-${TAG}"
|
# distdir="ClusterLabs-resource-agents-${TAG}"
|
||||||
# TARFILE="${distdir}.tar.gz"
|
# TARFILE="${distdir}.tar.gz"
|
||||||
# rm -rf $TARFILE $distdir
|
# rm -rf $TARFILE $distdir
|
||||||
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
|
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
|
||||||
#
|
#
|
||||||
|
# # Source1:
|
||||||
|
# git checkout <version tag>
|
||||||
|
# TAG=$(git log --pretty="format:%h" -n 1)
|
||||||
|
# distdir="SAPStartSrv-resourceAgent-${TAG}"
|
||||||
|
# TARFILE="${distdir}.tar.gz"
|
||||||
|
# rm -rf $TARFILE $distdir
|
||||||
|
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
|
||||||
|
#
|
||||||
|
|
||||||
%global upstream_prefix ClusterLabs-resource-agents
|
%global upstream_prefix ClusterLabs-resource-agents
|
||||||
%global upstream_version e711383f
|
%global upstream_version a6ccb93a
|
||||||
|
|
||||||
%global sap_script_prefix sap_cluster_connector
|
%global sapstart_prefix SAPStartSrv-resourceAgent
|
||||||
%global sap_script_hash 0015fe2
|
%global sapstart_version 1758e33
|
||||||
|
|
||||||
Name: resource-agents-sap
|
# Whether this platform defaults to using systemd as an init system
|
||||||
Summary: SAP cluster resource agents
|
# (needs to be evaluated prior to BuildRequires being enumerated and
|
||||||
Version: 4.1.1
|
# installed as it's intended to conditionally select some of these, and
|
||||||
Release: 34%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
|
# for that there are only few indicators with varying reliability:
|
||||||
License: GPLv2+
|
# - presence of systemd-defined macros (when building in a full-fledged
|
||||||
URL: https://github.com/ClusterLabs/resource-agents
|
# environment, which is not the case with ordinary mock-based builds)
|
||||||
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
|
# - systemd-aware rpm as manifested with the presence of particular
|
||||||
Group: System Environment/Base
|
# 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 invocation
|
||||||
|
%bcond_with rgmanager
|
||||||
|
%bcond_without linuxha
|
||||||
|
|
||||||
|
Name: resource-agents-sap
|
||||||
|
Summary: SAP cluster resource agents
|
||||||
|
Version: 4.15.1
|
||||||
|
Release: 1%{?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: %{sapstart_prefix}-%{sapstart_version}.tar.gz
|
||||||
|
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
# Build dependencies
|
||||||
|
BuildRequires: make
|
||||||
|
BuildRequires: automake autoconf pkgconfig gcc
|
||||||
|
BuildRequires: libxslt glib2-devel libqb-devel
|
||||||
|
BuildRequires: systemd
|
||||||
|
BuildRequires: which
|
||||||
|
|
||||||
|
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
|
||||||
|
BuildRequires: python3-devel
|
||||||
%else
|
%else
|
||||||
Group: Productivity/Clustering/HA
|
BuildRequires: python-devel
|
||||||
%endif
|
%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
|
|
||||||
|
|
||||||
BuildArch: noarch
|
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
|
||||||
|
|
||||||
BuildRequires: automake autoconf gcc
|
|
||||||
BuildRequires: perl-interpreter python3-devel
|
|
||||||
BuildRequires: libxslt glib2-devel
|
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
|
|
||||||
BuildRequires: docbook-style-xsl docbook-dtds
|
BuildRequires: docbook-style-xsl docbook-dtds
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
|
BuildRequires: libnet-devel
|
||||||
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Requires: resource-agents >= 4.1.1
|
%if 0%{?suse_version}
|
||||||
|
BuildRequires: libnet-devel
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
BuildRequires: cluster-glue-devel
|
||||||
|
%else
|
||||||
|
BuildRequires: libglue-devel
|
||||||
|
%endif
|
||||||
|
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
|
||||||
|
%endif
|
||||||
|
|
||||||
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
|
BuildRequires: python3-psutil
|
||||||
|
|
||||||
|
Requires: resource-agents >= 4.8.0
|
||||||
|
Requires(post): systemd
|
||||||
|
Requires(preun): systemd
|
||||||
|
Requires(postun): systemd
|
||||||
|
|
||||||
|
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
|
||||||
|
Requires: python3 python3-psutil
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The SAP resource agents interface with Pacemaker to allow
|
The SAP resource agents interface with Pacemaker to allow
|
||||||
@ -68,25 +115,55 @@ SAP instances to be managed in a cluster environment.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{upstream_prefix}-%{upstream_version}
|
%setup -q -n %{upstream_prefix}-%{upstream_version}
|
||||||
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
|
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
|
||||||
%patch0 -p1
|
|
||||||
%patch1 -p1
|
# Move the agent to the others for the ClusterLabs included processing.
|
||||||
%patch2 -p1
|
mv %{sapstart_prefix}-%{sapstart_version}/ra/SAPStartSrv.in heartbeat
|
||||||
%patch3 -p1
|
|
||||||
%patch4 -p1
|
# Find the existing SAPInstance entry in the list and add 2 new after in corresponding formatting.
|
||||||
%patch5 -p1
|
# heartbeat/Makefile.am indents by 3 tabs in the target list
|
||||||
%patch6 -p1
|
# Skip the .in suffix, the agent is renamed in the process.
|
||||||
%patch7 -p1
|
sed -i -e 's/\(\t\tSAPInstance\t\t\\\)/\1\n\t\t\tSAPStartSrv\t\t\\/' heartbeat/Makefile.am
|
||||||
|
|
||||||
|
# Find the existing SAPInstance entry in the list and add 2 new after in corresponding formatting.
|
||||||
|
# doc/man/Makefile.am indents by 26 spaces in the target list
|
||||||
|
sed -i -e 's/\( \{26\}ocf_heartbeat_SAPInstance.7 \\\)/\1\n'\
|
||||||
|
' ocf_heartbeat_SAPStartSrv.7 \\/' doc/man/Makefile.am
|
||||||
|
|
||||||
|
# Add RA to configure.ac for processing during compilation.
|
||||||
|
# - renames python files after shebang fixup
|
||||||
|
# - enables man page creation
|
||||||
|
sed -i -e 's/\(AC_CONFIG_FILES..heartbeat.SysInfo.*\)/AC_CONFIG_FILES([heartbeat\/SAPStartSrv], [chmod +x heartbeat\/SAPStartSrv])\n\1/' configure.ac
|
||||||
|
|
||||||
%build
|
%build
|
||||||
if [ ! -f configure ]; then
|
if [ ! -f configure ]; then
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
fi
|
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}
|
||||||
PYTHON="%{__python3}" \
|
%global rasset rgmanager
|
||||||
%{conf_opt_fatal} \
|
%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}
|
%if %{defined _unitdir}
|
||||||
--with-systemdsystemunitdir=%{_unitdir} \
|
--with-systemdsystemunitdir=%{_unitdir} \
|
||||||
%endif
|
%endif
|
||||||
@ -94,66 +171,100 @@ fi
|
|||||||
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
|
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
|
||||||
--with-rsctmpdir=/run/resource-agents \
|
--with-rsctmpdir=/run/resource-agents \
|
||||||
%endif
|
%endif
|
||||||
--with-pkg-name=%{name} \
|
--with-pkg-name=resource-agents \
|
||||||
--with-ras-set=%{rasset}
|
--with-ras-set=%{rasset}
|
||||||
|
|
||||||
%if %{defined jobs}
|
make %{_smp_mflags}
|
||||||
JFLAGS="$(echo '-j%{jobs}')"
|
|
||||||
%else
|
|
||||||
JFLAGS="$(echo '%{_smp_mflags}')"
|
|
||||||
%endif
|
|
||||||
|
|
||||||
make $JFLAGS
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
rm -rf %{buildroot}
|
||||||
make install DESTDIR=%{buildroot}
|
make install DESTDIR=%{buildroot}
|
||||||
|
|
||||||
# remove other agents
|
# Remove other agents
|
||||||
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAP*" -exec rm {} \;
|
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAP*" -exec rm {} \;
|
||||||
find %{buildroot}/%{_mandir} -type f ! -iname "*SAP*" -exec rm {} \;
|
find %{buildroot}%{_mandir} -type f ! -iname "*SAP*" -exec rm {} \;
|
||||||
|
find %{buildroot}%{_unitdir} -type f ! -iname "sap*" -exec rm {} \;
|
||||||
|
|
||||||
cp %{sap_script_prefix}-%{sap_script_hash}/redhat/sap_redhat_cluster_connector %{buildroot}/%{_sbindir}/sap_redhat_cluster_connector
|
# Service units and script called by services.
|
||||||
|
install -D -m 0644 %{sapstart_prefix}-%{sapstart_version}/sbin/sapservices-move.in \
|
||||||
|
%{buildroot}%{_bindir}/sapservices-move
|
||||||
|
install -D -m 0644 %{sapstart_prefix}-%{sapstart_version}/service/* \
|
||||||
|
%{buildroot}%{_unitdir}
|
||||||
|
|
||||||
|
# Change hard-coded /usr/sbin to /usr/bin, where the sapservices-move script lives.
|
||||||
|
sed -i -e 's|%{_sbindir}|%{_bindir}|g' %{buildroot}%{_unitdir}/sap*
|
||||||
|
|
||||||
|
# Fix python shebang.
|
||||||
|
sed -i -e 's|@PYTHON@|%{__python3}|g' %{buildroot}%{_bindir}/sapservices-move
|
||||||
|
|
||||||
|
# License
|
||||||
|
mkdir -p %{buildroot}%{_defaultlicensedir}/%{name}
|
||||||
|
cp %{sapstart_prefix}-%{sapstart_version}/LICENSE %{buildroot}%{_defaultlicensedir}/%{name}
|
||||||
|
|
||||||
## tree fixup
|
## tree fixup
|
||||||
# remove docs (there is only one and they should come from doc sections in files)
|
# remove docs (there is only one and they should come from doc sections in files)
|
||||||
rm -rf %{buildroot}/usr/share/doc/resource-agents
|
rm -rf %{buildroot}/usr/share/doc/resource-agents
|
||||||
|
|
||||||
%clean
|
%post
|
||||||
rm -rf %{buildroot}
|
%systemd_post sapping.service
|
||||||
|
%systemd_post sappong.service
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%systemd_preun sapping.service
|
||||||
|
%systemd_preun sappong.service
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%systemd_postun sapping.service
|
||||||
|
%systemd_postun sappong.service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
%license LICENSE
|
||||||
%{_usr}/lib/ocf/resource.d/heartbeat/SAP*
|
%{_usr}/lib/ocf/resource.d/heartbeat/SAP*
|
||||||
%{_usr}/lib/ocf/lib/heartbeat/sap*
|
%{_usr}/lib/ocf/lib/heartbeat/sap*
|
||||||
%{_mandir}/man7/*SAP*
|
%{_mandir}/man7/*SAP*
|
||||||
%{_sbindir}/sap_redhat_cluster_connector
|
%defattr(755,root,root,-)
|
||||||
|
%{_bindir}/sap*
|
||||||
|
%defattr(644,root,root,-)
|
||||||
|
%{_unitdir}/sap*
|
||||||
|
|
||||||
%exclude /etc
|
%exclude /etc
|
||||||
%exclude /usr/include
|
%exclude /usr/include
|
||||||
%exclude %{_usr}/lib/debug
|
%exclude %{_usr}/lib/debug
|
||||||
%exclude %{_usr}/lib/systemd
|
|
||||||
%exclude %{_usr}/lib/tmpfiles.d
|
%exclude %{_usr}/lib/tmpfiles.d
|
||||||
%exclude /usr/libexec/heartbeat
|
%exclude /usr/libexec/heartbeat
|
||||||
%exclude /usr/sbin/ldirectord
|
%exclude /usr/sbin/ldirectord
|
||||||
%exclude /usr/sbin/ocf*
|
%exclude /usr/sbin/ocf*
|
||||||
%exclude /usr/share/%{name}
|
%exclude /usr/share/resource-agents
|
||||||
|
%exclude /usr/share/pkgconfig/resource-agents.pc
|
||||||
%exclude /usr/src
|
%exclude /usr/src
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Dec 07 2022 Janine Fuchs <jfuchs@redhat.com> - 4.1.1-34
|
* Fri Jan 10 2025 Janine Fuchs <jfuchs@redhat.com> - 4.15.1-1
|
||||||
|
- Add resource agent SAPStartSrv.
|
||||||
|
Resolves: RHEL-2294
|
||||||
|
|
||||||
|
* Wed Dec 07 2022 Janine Fuchs <jfuchs@redhat.com> - 4.10.0-3
|
||||||
- SAPInstance: be more resilient against broken kill.sap files
|
- 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
|
* Mon Nov 22 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-2
|
||||||
- SAPDatabase/SAPInstance: set correct agent and OCF version in metadata
|
- 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
|
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 4.8.0-2.1
|
||||||
- SAPInstance: add systemd support
|
- 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
|
* Fri Apr 17 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-30
|
||||||
- use safe temp file location
|
- use safe temp file location
|
||||||
@ -169,3 +280,5 @@ rm -rf %{buildroot}
|
|||||||
- Initial build as separate package
|
- Initial build as separate package
|
||||||
|
|
||||||
Resolves: rhbz#1688341
|
Resolves: rhbz#1688341
|
||||||
|
|
||||||
|
# vim:set ai ts=2 sw=2 sts=2 et:
|
||||||
|
Loading…
Reference in New Issue
Block a user