Compare commits

...

No commits in common. 'cs10' and 'c9' have entirely different histories.
cs10 ... c9

4
.gitignore vendored

@ -1,2 +1,2 @@
SOURCES/ClusterLabs-resource-agents-a6ccb93a.tar.gz
SOURCES/SAPStartSrv-resourceAgent-1758e33.tar.gz
SOURCES/ClusterLabs-resource-agents-fd0720f7.tar.gz
SOURCES/sap_cluster_connector-0015fe2.tar.gz

@ -1,2 +1,2 @@
1b9dca55ed882a6353ac3fdf2cbbe572ff2a1618 SOURCES/ClusterLabs-resource-agents-a6ccb93a.tar.gz
2cc07b55c836e0d7847fd52de89ed3d539281f7a SOURCES/SAPStartSrv-resourceAgent-1758e33.tar.gz
3b517ecdbe2103df77813050e5c998e102c5de7e SOURCES/ClusterLabs-resource-agents-fd0720f7.tar.gz
731c683ecc63b50fbc0823170e966b74ec2a0f51 SOURCES/sap_cluster_connector-0015fe2.tar.gz

@ -0,0 +1,46 @@
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,30 +12,18 @@
# Below is the script used to generate a new source file
# 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)
# distdir="ClusterLabs-resource-agents-${TAG}"
# TARFILE="${distdir}.tar.gz"
# rm -rf $TARFILE $distdir
# 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_version a6ccb93a
%global upstream_version fd0720f7
%global sapstart_prefix SAPStartSrv-resourceAgent
%global sapstart_version 1758e33
%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
@ -53,25 +41,26 @@
} || %{?__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
# 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.15.1
Release: 0%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}.1
License: GPLv2+
URL: https://github.com/ClusterLabs/resource-agents
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
Source1: %{sapstart_prefix}-%{sapstart_version}.tar.gz
Name: resource-agents-sap
Summary: SAP cluster resource agents
Version: 4.10.0
Release: 3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+
URL: https://github.com/ClusterLabs/resource-agents
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
Source1: %{sap_script_prefix}-%{sap_script_hash}.tar.gz
Patch0: bz2151293-SAPInstance-improve-killsap-logic.patch
BuildArch: noarch
BuildArch: noarch
# Build dependencies
BuildRequires: make
BuildRequires: automake autoconf pkgconfig gcc
BuildRequires: libxslt glib2-devel libqb-devel
BuildRequires: libxslt glib2-devel
BuildRequires: systemd
BuildRequires: which
@ -90,21 +79,13 @@ BuildRequires: libnet-devel
%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: resource-agents >= 4.8.0
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: resource-agents >= 4.8.0
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
Requires: python3 python3-psutil
%description
The SAP resource agents interface with Pacemaker to allow
@ -113,11 +94,11 @@ SAP instances to be managed in a cluster environment.
%prep
%setup -q -n %{upstream_prefix}-%{upstream_version}
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
%patch0 -p1
%build
if [ ! -f configure ]; then
./autogen.sh
./autogen.sh
fi
%if 0%{?fedora} >= 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
@ -142,9 +123,9 @@ export CFLAGS
%configure \
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
PYTHON="%{__python3}" \
PYTHON="%{__python3}" \
%endif
%{conf_opt_fatal} \
%{conf_opt_fatal} \
%if %{defined _unitdir}
--with-systemdsystemunitdir=%{_unitdir} \
%endif
@ -152,73 +133,42 @@ export CFLAGS
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
--with-rsctmpdir=/run/resource-agents \
%endif
--with-pkg-name=resource-agents \
--with-ras-set=%{rasset}
--with-pkg-name=resource-agents \
--with-ras-set=%{rasset}
make %{_smp_mflags}
%if %{defined jobs}
JFLAGS="$(echo '-j%{jobs}')"
%else
JFLAGS="$(echo '%{_smp_mflags}')"
%endif
make $JFLAGS
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# Remove other agents
# remove other agents
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAP*" -exec rm {} \;
find %{buildroot}%{_mandir} -type f ! -iname "*SAP*" -exec rm {} \;
find %{buildroot}%{_unitdir} -type f ! -iname "sap*" -exec rm {} \;
# Resource agent from Source1.
# Python script cannot be used for automatic man page creation during prep.
install -m 0755 %{sapstart_prefix}-%{sapstart_version}/ra/SAPStartSrv.in \
%{buildroot}%{_usr}/lib/ocf/resource.d/heartbeat/SAPStartSrv
# 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}
find %{buildroot}/%{_mandir} -type f ! -iname "*SAP*" -exec rm {} \;
# 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@ -tt|%{__python3}|g' \
%{buildroot}%{_usr}/lib/ocf/resource.d/heartbeat/SAPStartSrv
sed -i -e 's|@PYTHON@ -tt|%{__python3}|g' %{buildroot}%{_bindir}/sapservices-move
# License
mkdir -p %{buildroot}%{_defaultlicensedir}/%{name}
cp %{sapstart_prefix}-%{sapstart_version}/LICENSE %{buildroot}%{_defaultlicensedir}/%{name}
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
%post
%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
%defattr(-,root,root)
%license LICENSE
%{_usr}/lib/ocf/resource.d/heartbeat/SAP*
%{_usr}/lib/ocf/lib/heartbeat/sap*
%{_mandir}/man7/*SAP*
%defattr(755,root,root,-)
%{_bindir}/sap*
%defattr(644,root,root,-)
%{_unitdir}/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
@ -228,17 +178,39 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
%exclude /usr/src
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.15.1-0.1
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Wed Dec 07 2022 Janine Fuchs <jfuchs@redhat.com> - 4.10.0-3
- SAPInstance: be more resilient against broken kill.sap files
Resolves: rhbz#2151293
* Mon Nov 22 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-2
- Rebase to resource-agents 4.10.0 upstream release.
Resolves: rhbz#2024660
* 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
* 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
Resolves: rhbz#1817439
* Tue Aug 20 2024 Janine Fuchs <jfuchs@redhat.com> - 4.15.1
- Add resource agent SAPStartSrv.
Resolves: RHEL-55135
* Thu Jan 23 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-29
- SAPInstance: add reload-action
* Fri Jul 12 2024 Janine Fuchs <jfuchs@redhat.com> - 4.14.0
- Add package to RHEL 10.
Resolves: RHEL-40573
Resolves: rhbz#1751949
* Tue Jun 18 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-28
- Initial build as separate package
# vim:set ai ts=2 sw=2 sts=2 et:
Resolves: rhbz#1688341

Loading…
Cancel
Save