diff --git a/ClusterLabs-resource-agents-e76b7d3a.tar.gz b/ClusterLabs-resource-agents-e76b7d3a.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8afb8d76505ead8db0667b198f6eb2470c8eee79 Binary files /dev/null and b/ClusterLabs-resource-agents-e76b7d3a.tar.gz differ diff --git a/fix-failed-to-parse-pid-from-pid-file.patch b/fix-failed-to-parse-pid-from-pid-file.patch deleted file mode 100644 index 1dafa83556bd229c4f4e9cd4eec09815d8915424..0000000000000000000000000000000000000000 --- a/fix-failed-to-parse-pid-from-pid-file.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 60366e7a877919b7767736cbbb7850588f461490 Mon Sep 17 00:00:00 2001 -From: caodongxia <315816521@qq.com> -Date: Wed, 25 Aug 2021 16:12:22 +0800 -Subject: [PATCH] fix failed to parse pid from pid-file - ---- - ldirectord/systemd/ldirectord.service.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/ldirectord/systemd/ldirectord.service.in b/ldirectord/systemd/ldirectord.service.in -index 191f62a..aafc2dc 100644 ---- a/ldirectord/systemd/ldirectord.service.in -+++ b/ldirectord/systemd/ldirectord.service.in -@@ -4,6 +4,7 @@ Documentation=man:ldirectord(8) - - [Service] - ExecStart=@sbindir@/ldirectord start -+ExecStartPost=/usr/bin/sleep 0.1 - ExecStartPost=/usr/bin/touch /var/lock/subsys/ldirectord - ExecStop=@sbindir@/ldirectord stop - ExecStopPost=@RM@ -f /var/lock/subsys/ldirectord --- -2.27.0 - diff --git a/resource-agents.spec b/resource-agents.spec index 3a7d32b7d26d80f2b527f31736f65828a37b06ca..0eacc9d74a09fc3b04e985a6aa57e6a5f5b4d7d1 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,111 +1,384 @@ -Name: resource-agents -Summary: Open Source HA Reusable Cluster Resource Scripts -Version: 4.2.0 -Release: 4 -License: GPLv2+ and LGPLv2+ -URL: https://github.com/ClusterLabs/resource-agents -Source0: https://github.com/ClusterLabs/resource-agents/archive/v4.2.0.tar.gz -Patch0000: fix-failed-to-parse-pid-from-pid-file.patch -Obsoletes: heartbeat-resources <= %{version} -Provides: heartbeat-resources = %{version} -BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel -BuildRequires: libxslt glib2-devel which docbook-style-xsl docbook-dtds -Requires: bash grep sed gawk procps-ng hostname net-tools psmisc util-linux -Requires: e2fsprogs xfsprogs nfs-utils cifs-utils iproute lvm2 +# +# 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 e76b7d3a + +# 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 $?)) + +# SSLeay (required by ldirectord) +%if 0%{?suse_version} +%global SSLeay perl-Net_SSLeay +%else +%global SSLeay perl-Net-SSLeay +%endif + +# determine the ras-set to process based on configure invokation +%bcond_with rgmanager +%bcond_without linuxha + +Name: resource-agents +Summary: Open Source HA Reusable Cluster Resource Scripts +Version: 4.8.0 +Release: 1 +License: GPLv2+ and LGPLv2+ +URL: https://github.com/ClusterLabs/resource-agents +Source0: %{upstream_prefix}-%{upstream_version}.tar.gz +Obsoletes: heartbeat-resources <= %{version} +Provides: heartbeat-resources = %{version} + +# Build dependencies +BuildRequires: make +BuildRequires: automake autoconf pkgconfig gcc +BuildRequires: perl +BuildRequires: libxslt glib2-devel +BuildRequires: systemd +BuildRequires: which + +%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version} +BuildRequires: python3-devel +%else +BuildRequires: python-devel +%endif + +%ifarch x86_64 +%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 +BuildRequires: python3-google-api-client python3-pyroute2 +%endif +%if 0%{?suse_version} +BuildRequires: python3-google-api-python-client +%endif +%endif + +%if 0%{?fedora} || 0%{?centos} || 0%{?rhel} +BuildRequires: docbook-style-xsl docbook-dtds +%if 0%{?rhel} == 0 +BuildRequires: libnet-devel +%endif +%endif + +%if 0%{?suse_version} +BuildRequires: libnet-devel +BuildRequires: libglue-devel +BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets +%endif + +## Runtime deps +# system tools shared by several agents +Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk +Requires: /bin/ps /usr/bin/pkill /usr/bin/hostname /usr/bin/netstat +Requires: /usr/sbin/fuser /bin/mount + +# Filesystem / fs.sh / netfs.sh +Requires: /sbin/fsck +Requires: /usr/sbin/fsck.ext2 /usr/sbin/fsck.ext3 /usr/sbin/fsck.ext4 +Requires: /usr/sbin/fsck.xfs +Requires: /sbin/mount.nfs /sbin/mount.nfs4 +%if 0%{?fedora} < 33 || (0%{?rhel} && 0%{?rhel} < 9) || (0%{?centos} && 0%{?centos} < 9) || 0%{?suse_version} +%if (0%{?rhel} && 0%{?rhel} < 8) || (0%{?centos} && 0%{?centos} < 8) +Requires: /usr/sbin/mount.cifs +%else +Recommends: /usr/sbin/mount.cifs +%endif +%endif + +# IPaddr2 +Requires: /sbin/ip + +# LVM / lvm.sh +Requires: /usr/sbin/lvm + +# nfsserver / netfs.sh +Requires: /usr/sbin/rpc.nfsd /sbin/rpc.statd /usr/sbin/rpc.mountd + +# ocf-distro +#Requires: /usr/bin/lsb_release + +# rgmanager +%if %{with rgmanager} +# ip.sh +Requires: /usr/sbin/ethtool +Requires: /sbin/rdisc /usr/sbin/arping /bin/ping /bin/ping6 + +# nfsexport.sh +Requires: /sbin/findfs +Requires: /sbin/quotaon /sbin/quotacheck +%endif + %description -Resource agent is a standardized interface for a cluster resource. In translates a standard set of operations into -steps specific to the resource or application, and interprets their results as success or failure. +A set of scripts to interface with several services to operate in a +High Availability environment for both Pacemaker and rgmanager +service managers. +%if %{with linuxha} %package -n ldirectord -License: GPLv2+ -Summary: Monitoring Daemon for Maintaining High Availability Resources -Obsoletes: heartbeat-ldirectord <= %{version} -Provides: heartbeat-ldirectord = %{version} -BuildRequires: perl-podlators -Requires: perl-Net-SSLeay perl-libwww-perl perl-MailTools ipvsadm logrotate -BuildRequires: systemd +License: GPLv2+ +Summary: A Monitoring Daemon for Maintaining High Availability Resources +%if 0%{?fedora} || 0%{?centos} || 0%{?rhel} +%else +%endif +Obsoletes: heartbeat-ldirectord <= %{version} +Provides: heartbeat-ldirectord = %{version} +%if 0%{?fedora} > 18 || 0%{?centos} > 6 || 0%{?rhel} > 6 +BuildRequires: perl-podlators +%endif +Requires: %{SSLeay} perl-libwww-perl perl-MailTools +Requires: ipvsadm logrotate +%if 0%{?fedora} +Requires: perl-Net-IMAP-Simple-SSL perl-IO-Socket-INET6 +Requires(post): /sbin/chkconfig +Requires(preun):/sbin/chkconfig +%endif +%if %{systemd_native} +BuildRequires: systemd +%endif %{?systemd_requires} + %description -n ldirectord -Ldirectord is a daemon to monitor and administer real servers in a cluster of load -balanced virtual servers.Currently, HTTP, HTTPS, and FTP services are supported. -ldirectord typically is started from heartbeat but can also be run from the command line. +The Linux Director Daemon (ldirectord) was written by Jacob Rief. + -%package help -Summary: Help documentation for resource-agents -%description help -Help documentation for resource-agents. +ldirectord is a stand alone daemon for monitoring the services on real +servers. Currently, HTTP, HTTPS, and FTP services are supported. +ldirectord is simple to install and works with Pacemaker +(http://clusterlabs.org/). + +See 'ldirectord -h' and linux-ha/doc/ldirectord for more information. +%endif %prep -%autosetup -n %{name}-%{version} -p1 +%if 0%{?suse_version} == 0 && 0%{?fedora} == 0 && 0%{?centos} == 0 && 0%{?rhel} == 0 +%{error:Unable to determine the distribution/version. This is generally caused by missing /etc/rpm/macros.dist. Please install the correct build packages or define the required macros manually.} +exit 1 +%endif +%autosetup -n %{upstream_prefix}-%{upstream_version} -p1 %build if [ ! -f configure ]; then - ./autogen.sh + ./autogen.sh fi -export CFLAGS="$(echo '%{optflags}')" + +%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 + +%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 \ - %{conf_opt_fatal} --with-systemdsystemunitdir=%{_unitdir} --with-systemdtmpfilesdir=%{_tmpfilesdir} \ - --with-pkg-name=%{name} --with-ras-set=linux-ha -%make_build +%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version} + PYTHON="%{__python3}" \ +%endif + %{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 +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} + +## 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 + +%if %{with linuxha} +%if 0%{?suse_version} +test -d %{buildroot}/sbin || mkdir %{buildroot}/sbin +( + cd %{buildroot}/sbin + ln -sf /%{_sysconfdir}/init.d/ldirectord rcldirectord +) || true +%endif +%endif %files -%doc AUTHORS COPYING COPYING.GPLv3 COPYING.LGPL +%doc AUTHORS COPYING COPYING.GPLv3 COPYING.LGPL ChangeLog +%if %{with linuxha} +%doc heartbeat/README.galera %doc doc/README.webapps +%doc %{_datadir}/%{name}/ra-api-1.dtd +%doc %{_datadir}/%{name}/metadata.rng +%endif + +%if %{with rgmanager} +%{_datadir}/cluster +%{_sbindir}/rhev-check.sh +%endif + +%if %{with linuxha} %dir %{_usr}/lib/ocf %dir %{_usr}/lib/ocf/resource.d %dir %{_usr}/lib/ocf/lib + %{_usr}/lib/ocf/lib/heartbeat + %{_usr}/lib/ocf/resource.d/heartbeat +%if %{with rgmanager} +%{_usr}/lib/ocf/resource.d/redhat +%endif + +%{_datadir}/pkgconfig/%{name}.pc + +%if %{defined _unitdir} %{_unitdir}/resource-agents-deps.target +%endif +%if %{defined _tmpfilesdir} +%{_tmpfilesdir}/%{name}.conf +%endif + %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/ocft -%{_tmpfilesdir}/%{name}.conf -%{_datadir}/%{name}/ocft/{configs,caselib,README,README.zh_CN,helpers.sh} -%exclude %{_datadir}/%{name}/ocft/{runocft,runocft.prereq} +%{_datadir}/%{name}/ocft/configs +%{_datadir}/%{name}/ocft/caselib +%{_datadir}/%{name}/ocft/README +%{_datadir}/%{name}/ocft/README.zh_CN +%{_datadir}/%{name}/ocft/helpers.sh +%exclude %{_datadir}/%{name}/ocft/runocft +%exclude %{_datadir}/%{name}/ocft/runocft.prereq + %{_sbindir}/ocf-tester %{_sbindir}/ocft +%if 0%{?suse_version} +%{_sbindir}/sfex_* +%endif + %{_includedir}/heartbeat -%dir %attr (1755, root, root) %{_var}/run/resource-agents + +%if %{defined _tmpfilesdir} +%dir %attr (1755, root, root) /run/resource-agents +%else +%dir %attr (1755, root, root) %{_var}/run/resource-agents +%endif + +%{_mandir}/man7/*.7* +%{_mandir}/man8/ocf-tester.8* +%if 0%{?suse_version} +%{_mandir}/man8/sfex_init.8* +%endif + +# For compatability with pre-existing agents %dir %{_sysconfdir}/ha.d %{_sysconfdir}/ha.d/shellfuncs + %{_libexecdir}/heartbeat +%if %{with rgmanager} +%post -n resource-agents +ccs_update_schema > /dev/null 2>&1 ||: +%endif + +%if 0%{?suse_version} %preun -n ldirectord -%systemd_preun ldirectord.service +%stop_on_removal ldirectord +%postun -n ldirectord +%insserv_cleanup +%endif +%if 0%{?fedora} +%preun -n ldirectord +%if %{defined _unitdir} +%systemd_preun ldirectord.service +%else +/sbin/chkconfig --del ldirectord +%endif %postun -n ldirectord /sbin/ldconfig +%if %{defined _unitdir} %systemd_postun_with_restart ldirectord.service - +%endif %post -n ldirectord +%if %{defined _unitdir} %systemd_post ldirectord.service +%else +/sbin/chkconfig --add ldirectord +%endif +%endif +%endif +%if %{with linuxha} %files -n ldirectord %{_sbindir}/ldirectord -%doc COPYING ldirectord/ldirectord.cf +%doc ldirectord/ldirectord.cf COPYING +%{_mandir}/man8/ldirectord.8* %config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord %dir %{_sysconfdir}/ha.d %dir %{_sysconfdir}/ha.d/resource.d %{_sysconfdir}/ha.d/resource.d/ldirectord +%if %{defined _unitdir} %{_unitdir}/ldirectord.service %exclude %{_sysconfdir}/init.d/ldirectord - -%files help -%doc heartbeat/README.galera ChangeLog -%doc %{_datadir}/%{name}/{ra-api-1.dtd,metadata.rng} -%{_mandir}/man7/*.7* -%{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} +%exclude %{_sysconfdir}/rc.d/init.d/ldirectord +%else +%{_sysconfdir}/init.d/ldirectord +%endif +%if 0%{?suse_version} +/sbin/rcldirectord +%endif +%if 0%{?fedora} +%{_usr}/lib/ocf/resource.d/heartbeat/ldirectord +%endif +%endif %changelog -* Wed Aug 25 2021 caodongxia - 4.2.0-4 -- Fix failed to parse pid from pid-file - -* Tue Oct 27 2020 Anan Fu - 4.2.0-3 -- disable python2 - -* Thu Mar 5 2020 shijian - 4.2.0-2 -- Package init +* Wed May 31 2023 zhaochaoxiang - 4.8.0-1 +- upgrade to 4.8.0 diff --git a/v4.2.0.tar.gz b/v4.2.0.tar.gz deleted file mode 100644 index d4e1043579e90b8ebf4fac3981660550dea89dd7..0000000000000000000000000000000000000000 Binary files a/v4.2.0.tar.gz and /dev/null differ