- Add resource agent SAPStartSrv.
Resolves: RHEL-2294
This commit is contained in:
parent
77655268ff
commit
e107a8e096
@ -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,18 +12,30 @@
|
|||||||
# 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 fd0720f7
|
%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
|
||||||
|
|
||||||
# Whether this platform defaults to using systemd as an init system
|
# Whether this platform defaults to using systemd as an init system
|
||||||
# (needs to be evaluated prior to BuildRequires being enumerated and
|
# (needs to be evaluated prior to BuildRequires being enumerated and
|
||||||
@ -41,26 +53,25 @@
|
|||||||
} || %{?__transaction_systemd_inhibit:1}%{!?__transaction_systemd_inhibit:0}%{nil \
|
} || %{?__transaction_systemd_inhibit:1}%{!?__transaction_systemd_inhibit:0}%{nil \
|
||||||
} || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?))
|
} || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?))
|
||||||
|
|
||||||
# determine the ras-set to process based on configure invokation
|
# determine the ras-set to process based on configure invocation
|
||||||
%bcond_with rgmanager
|
%bcond_with rgmanager
|
||||||
%bcond_without linuxha
|
%bcond_without linuxha
|
||||||
|
|
||||||
Name: resource-agents-sap
|
Name: resource-agents-sap
|
||||||
Summary: SAP cluster resource agents
|
Summary: SAP cluster resource agents
|
||||||
Version: 4.10.0
|
Version: 4.15.1
|
||||||
Release: 3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
|
Release: 1%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://github.com/ClusterLabs/resource-agents
|
URL: https://github.com/ClusterLabs/resource-agents
|
||||||
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
|
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
|
||||||
Source1: %{sap_script_prefix}-%{sap_script_hash}.tar.gz
|
Source1: %{sapstart_prefix}-%{sapstart_version}.tar.gz
|
||||||
Patch0: bz2151293-SAPInstance-improve-killsap-logic.patch
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
# Build dependencies
|
# Build dependencies
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: automake autoconf pkgconfig gcc
|
BuildRequires: automake autoconf pkgconfig gcc
|
||||||
BuildRequires: libxslt glib2-devel
|
BuildRequires: libxslt glib2-devel libqb-devel
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
BuildRequires: which
|
BuildRequires: which
|
||||||
|
|
||||||
@ -79,13 +90,23 @@ BuildRequires: libnet-devel
|
|||||||
|
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
BuildRequires: libnet-devel
|
BuildRequires: libnet-devel
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
BuildRequires: cluster-glue-devel
|
||||||
|
%else
|
||||||
BuildRequires: libglue-devel
|
BuildRequires: libglue-devel
|
||||||
|
%endif
|
||||||
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
|
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Requires: resource-agents >= 4.8.0
|
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: /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
|
||||||
@ -94,11 +115,28 @@ 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
|
|
||||||
|
# Move the agent to the others for the ClusterLabs included processing.
|
||||||
|
mv %{sapstart_prefix}-%{sapstart_version}/ra/SAPStartSrv.in heartbeat
|
||||||
|
|
||||||
|
# Find the existing SAPInstance entry in the list and add 2 new after in corresponding formatting.
|
||||||
|
# heartbeat/Makefile.am indents by 3 tabs in the target list
|
||||||
|
# Skip the .in suffix, the agent is renamed in the process.
|
||||||
|
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
|
||||||
|
|
||||||
%if 0%{?fedora} >= 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
|
%if 0%{?fedora} >= 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
|
||||||
@ -123,9 +161,9 @@ export CFLAGS
|
|||||||
|
|
||||||
%configure \
|
%configure \
|
||||||
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
|
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
|
||||||
PYTHON="%{__python3}" \
|
PYTHON="%{__python3}" \
|
||||||
%endif
|
%endif
|
||||||
%{conf_opt_fatal} \
|
%{conf_opt_fatal} \
|
||||||
%if %{defined _unitdir}
|
%if %{defined _unitdir}
|
||||||
--with-systemdsystemunitdir=%{_unitdir} \
|
--with-systemdsystemunitdir=%{_unitdir} \
|
||||||
%endif
|
%endif
|
||||||
@ -133,42 +171,66 @@ export CFLAGS
|
|||||||
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
|
--with-systemdtmpfilesdir=%{_tmpfilesdir} \
|
||||||
--with-rsctmpdir=/run/resource-agents \
|
--with-rsctmpdir=/run/resource-agents \
|
||||||
%endif
|
%endif
|
||||||
--with-pkg-name=resource-agents \
|
--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}
|
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
|
||||||
|
|
||||||
|
%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
|
%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
|
||||||
@ -178,6 +240,10 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
|
|||||||
%exclude /usr/src
|
%exclude /usr/src
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* 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
|
* 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
|
||||||
|
|
||||||
@ -214,3 +280,5 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
|
|||||||
- 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:
|
||||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (ClusterLabs-resource-agents-fd0720f7.tar.gz) = 0ece911082accc38c680e0cf5b4becaa33575e53041125687f1e6b2a6b5e56eebe79ca094cadb0c9450ae269ba9c2ef3dfba4a0da3a06d2c00deefb02f969a04
|
SHA512 (ClusterLabs-resource-agents-a6ccb93a.tar.gz) = 3ea92f051f16efbd0845d193cc7d2e7d8e9f66ba8e2bbba3a7b8d093ceff3103f8077b93037067dee8962a7d5c1ad0a0b5642acbaf385b0619cef96f18928911
|
||||||
SHA512 (sap_cluster_connector-0015fe2.tar.gz) = 4005350d6fb8d2999861f1cc5f56335d2688c040067e4a01f565953bc060c605e77933d5033b32f9cf6e901ddbf9f5311842e716a832d931d6ffba0ff9e7eac8
|
SHA512 (SAPStartSrv-resourceAgent-1758e33.tar.gz) = 3460cc57bae99c390e80e8b5b92be3a62fb635161901a1d1d1cc68c38d03810e6e4f9b15a5a57eb4416f25d5f939202e1830f5b0b165ceb902d1f8fb53bc4876
|
||||||
|
Loading…
Reference in New Issue
Block a user