import resource-agents-sap-4.1.1-29.el8

This commit is contained in:
CentOS Sources 2020-04-23 23:00:27 +00:00 committed by Stepan Oksanichenko
commit fec070c98d
6 changed files with 300 additions and 0 deletions

2
.gitignore vendored Normal file
View File

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

View File

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

View File

@ -0,0 +1,92 @@
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

@ -0,0 +1,26 @@
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

@ -0,0 +1,37 @@
--- 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

@ -0,0 +1,141 @@
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Below is the script used to generate a new source file
# from the resource-agent upstream git repo.
#
# TAG=$(git log --pretty="format:%h" -n 1)
# distdir="ClusterLabs-resource-agents-${TAG}"
# TARFILE="${distdir}.tar.gz"
# rm -rf $TARFILE $distdir
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
#
%global upstream_prefix ClusterLabs-resource-agents
%global upstream_version e711383f
%global sap_script_prefix sap_cluster_connector
%global sap_script_hash 0015fe2
Name: resource-agents-sap
Summary: SAP cluster resource agents
Version: 4.1.1
Release: 29%{?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
BuildArch: noarch
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
%endif
Requires: resource-agents >= 4.1.1
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
%description
The SAP resource agents interface with Pacemaker to allow
SAP instances to be managed in a cluster environment.
%prep
%setup -q -n %{upstream_prefix}-%{upstream_version}
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
if [ ! -f configure ]; then
./autogen.sh
fi
%global rasset linux-ha
%configure BASH_SHELL="/bin/bash" \
PYTHON="%{__python3}" \
%{conf_opt_fatal} \
%if %{defined _unitdir}
--with-systemdsystemunitdir=%{_unitdir} \
%endif
%if %{defined _tmpfilesdir}
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
--with-rsctmpdir=/run/resource-agents \
%endif
--with-pkg-name=%{name} \
--with-ras-set=%{rasset}
%if %{defined jobs}
JFLAGS="$(echo '-j%{jobs}')"
%else
JFLAGS="$(echo '%{_smp_mflags}')"
%endif
make $JFLAGS
%install
make install DESTDIR=%{buildroot}
# remove other agents
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAP*" -exec rm {} \;
find %{buildroot}/%{_mandir} -type f ! -iname "*SAP*" -exec rm {} \;
cp %{sap_script_prefix}-%{sap_script_hash}/redhat/sap_redhat_cluster_connector %{buildroot}/%{_sbindir}/sap_redhat_cluster_connector
## tree fixup
# 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*
/usr/lib/ocf/lib/heartbeat/sap*
%{_mandir}/man7/*SAP*
%{_sbindir}/sap_redhat_cluster_connector
%exclude /etc
%exclude /usr/include
%exclude /usr/lib/debug
%exclude /usr/lib/systemd
%exclude /usr/lib/tmpfiles.d
%exclude /usr/libexec/heartbeat
%exclude /usr/sbin/ldirectord
%exclude /usr/sbin/ocf*
%exclude /usr/share/%{name}
%exclude /usr/src
%changelog
* Thu Jan 23 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-29
- SAPInstance: add reload-action
Resolves: rhbz#1751949
* Tue Jun 18 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-28
- Initial build as separate package
Resolves: rhbz#1688341