diff --git a/resource-agents.spec.in b/resource-agents.spec.in index 0211cae8e..443e2dc85 100644 --- a/resource-agents.spec.in +++ b/resource-agents.spec.in @@ -1,344 +1,346 @@ # # 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. # %global rcver @rcver@ %global alphatag @alphatag@ %global numcomm @numcomm@ %global dirty @dirty@ # # Since this spec file supports multiple distributions, ensure we # use the correct group for each. # # 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_@rgmanager@ rgmanager %bcond_@linux-ha@ linuxha # build with HA_BIN compatibility for the existing Heartbeat stack %bcond_@compat-habindir@ compat_habindir %if %{with compat_habindir} %global _libexecdir %{_libdir} %endif Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: @version@ Release: @specver@%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ 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: %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.bz2 Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} ## Setup/build bits BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # Build dependencies BuildRequires: automake autoconf pkgconfig BuildRequires: perl python-devel BuildRequires: libxslt glib2-devel BuildRequires: which %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} BuildRequires: cluster-glue-libs-devel BuildRequires: docbook-style-xsl docbook-dtds %if 0%{?rhel} == 0 BuildRequires: libnet-devel %endif %endif %if 0%{?suse_version} %if 0%{?suse_version} >= 1140 BuildRequires: libnet1 %else BuildRequires: libnet %endif BuildRequires: libglue-devel BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets %endif ## Runtime deps ## These apply to rgmanager agents only to guarantee agents ## are functional %if %{with rgmanager} # system tools shared by several agents Requires: /bin/bash /bin/grep /bin/sed /bin/gawk Requires: /bin/ps /usr/bin/pkill /bin/hostname Requires: /sbin/fuser Requires: /sbin/findfs /bin/mount # fs.sh Requires: /sbin/quotaon /sbin/quotacheck Requires: /sbin/fsck Requires: /sbin/fsck.ext2 /sbin/fsck.ext3 /sbin/fsck.ext4 Requires: /sbin/fsck.xfs # ip.sh Requires: /sbin/ip /usr/sbin/ethtool Requires: /sbin/rdisc /usr/sbin/arping /bin/ping /bin/ping6 # lvm.sh Requires: /sbin/lvm # netfs.sh Requires: /sbin/mount.nfs /sbin/mount.nfs4 /sbin/mount.cifs Requires: /usr/sbin/rpc.nfsd /sbin/rpc.statd /usr/sbin/rpc.mountd %endif %description 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: A Monitoring Daemon for Maintaining High Availability Resources %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} Group: System Environment/Daemons %else Group: Productivity/Clustering/HA %endif Obsoletes: heartbeat-ldirectord <= %{version} Provides: heartbeat-ldirectord = %{version} %if 0%{?fedora} > 18 || 0%{?centos_version} > 6 || 0%{?rhel} > 6 BuildRequires: perl-podlators %endif Requires: %{SSLeay} perl-libwww-perl perl-MailTools Requires: ipvsadm logrotate %if 0%{?fedora_version} Requires: perl-Net-IMAP-Simple-SSL Requires(post): /sbin/chkconfig Requires(preun):/sbin/chkconfig %endif %if %{defined systemd_requires} BuildRequires: systemd %{?systemd_requires} %endif %description -n ldirectord The Linux Director Daemon (ldirectord) was written by Jacob Rief. ldirectord is a stand alone daemon for monitoring the services on real servers. Currently, HTTP, HTTPS, and FTP services are supported. lditrecord is simple to install and works with the heartbeat code (http://www.linux-ha.org/). See 'ldirectord -h' and linux-ha/doc/ldirectord for more information. %endif %prep %if 0%{?suse_version} == 0 && 0%{?fedora} == 0 && 0%{?centos_version} == 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 %setup -q -n %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} %build if [ ! -f configure ]; then ./autogen.sh fi %if 0%{?fedora} >= 11 || 0%{?centos_version} > 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_rsctmpdir:%conf_opt_rsctmpdir} \ %{conf_opt_fatal} \ %if %{defined _unitdir} --with-systemdsystemunitdir=%{_unitdir} \ %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 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 %if %{defined _unitdir} ln -s /usr/sbin/service rcldirectord %else ln -sf /%{_sysconfdir}/init.d/ldirectord rcldirectord %endif ) || true %endif %endif %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc AUTHORS COPYING COPYING.GPLv3 COPYING.LGPL ChangeLog %if %{with linuxha} %doc doc/README.webapps %doc %{_datadir}/%{name}/ra-api-1.dtd %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 %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/ocft %{_datadir}/%{name}/ocft/configs %{_datadir}/%{name}/ocft/caselib +%{_datadir}/%{name}/ocft/runocft +%{_datadir}/%{name}/ocft/runocft.prereq %{_datadir}/%{name}/ocft/README %{_datadir}/%{name}/ocft/README.zh_CN %{_sbindir}/ocf-tester %{_sbindir}/ocft %{_sbindir}/sfex_init %{_sbindir}/sfex_stat %{_includedir}/heartbeat %dir %attr (1755, root, root) %{_var}/run/resource-agents %{_mandir}/man7/*.7* %{_mandir}/man8/ocf-tester.8* %{_mandir}/man8/sfex_init.8* # For compatability with pre-existing agents %dir %{_sysconfdir}/ha.d %{_sysconfdir}/ha.d/shellfuncs %{_libexecdir}/heartbeat %post -n resource-agents if [ $1 = 2 ]; then if [ -d %{_var}/run/heartbeat/rsctmp ]; then cp -fpr %{_var}/run/heartbeat/rsctmp/* %{_var}/run/resource-agents/ 1>/dev/null 2>&1 rm -fr %{_var}/run/heartbeat/rsctmp fi fi %if %{with rgmanager} ccs_update_schema > /dev/null 2>&1 ||: %endif %if 0%{?suse_version} %preun -n ldirectord %if %{defined _unitdir} %service_del_preun ldirectord.service %else %stop_on_removal ldirectord %endif %postun -n ldirectord %if %{defined _unitdir} %service_del_postun ldirectord.service %else %insserv_cleanup %endif %post -n ldirectord %if %{defined _unitdir} %service_add_post ldirectord.service %endif %pre -n ldirectord %if %{defined _unitdir} %service_add_pre ldirectord.service %endif %endif %if 0%{?fedora} %preun -n ldirectord /sbin/chkconfig --del ldirectord %postun -n ldirectord -p /sbin/ldconfig %post -n ldirectord /sbin/chkconfig --add ldirectord %endif %files -n ldirectord %defattr(-,root,root) %{_sbindir}/ldirectord %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 %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 * @date@ Autotools generated version - @version@-@specver@-@numcomm@.@alphatag@.@dirty@ - Autotools generated version diff --git a/tools/ocft/Makefile.am b/tools/ocft/Makefile.am index 6218bc370..897ab38e2 100644 --- a/tools/ocft/Makefile.am +++ b/tools/ocft/Makefile.am @@ -1,60 +1,62 @@ # Author: John Shi # jshi@suse.de # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(ocftcfgs_DATA) $(ocft_DATA) sbin_SCRIPTS = ocft ocftcfgsdir = $(datadir)/$(PACKAGE_NAME)/ocft/configs ocftcfgs_DATA = apache \ IPaddr2 \ IPaddr2v4 \ IPaddr2v6 \ IPv6addr \ Filesystem \ LVM \ Raid1 \ IPsrcaddr \ MailTo \ jboss \ mysql \ mysql-proxy \ pgsql \ db2 \ oracle \ drbd.linbit \ exportfs \ exportfs-multidir \ nfsserver \ portblock \ iscsi \ named \ postfix \ sg_persist \ tomcat \ Xinetd \ Xen \ VirtualDomain \ SendArp ocftdir = $(datadir)/$(PACKAGE_NAME)/ocft ocft_DATA = README \ README.zh_CN \ - caselib + caselib \ + runocft.prereq +ocft_SCRIPTS = runocft diff --git a/tools/ocft/runocft b/tools/ocft/runocft new file mode 100755 index 000000000..f66b6a462 --- /dev/null +++ b/tools/ocft/runocft @@ -0,0 +1,37 @@ +OCFTDIR=/usr/share/resource-agents/ocft +CONFDIR=$OCFTDIR/configs + +prereq_run() { + eval "$@" +} +prereq_prog() { + which $@ +} + +test_prereq() { + local tp arg + tp=`echo $prereq|sed 's/:.*//'` + arg=`echo $prereq|sed 's/[a-z]*://'` + prereq_$tp $arg >/dev/null 2>&1 +} + +rm -f ocft.FAILED +rc=0 +while read f prereq; do + if [ -n "$prereq" ] && ! test_prereq; then + echo "$f: prerequisite not fulfilled, skipping" + continue + fi + ocft make $f + if ! ocft test $f; then + echo $f >> ocft.FAILED + rc=1 + fi +done < $OCFTDIR/runocft.prereq + +if [ -f ocft.FAILED ]; then + echo "The following ocft tests failed:" + cat ocft.FAILED +fi + +exit $rc diff --git a/tools/ocft/runocft.prereq b/tools/ocft/runocft.prereq new file mode 100644 index 000000000..e66d7d9c4 --- /dev/null +++ b/tools/ocft/runocft.prereq @@ -0,0 +1,30 @@ +apache +db2 prog:~db2inst1/sqllib/bin/db2 +drbd.linbit run:false +exportfs +exportfs-multidir +Filesystem +IPaddr2 run:ip addr show dev eth0 +IPaddr2v4 run:ip addr show dev eth0 && ip addr show dev eth1 +IPaddr2v6 run:ip addr show dev eth0 && ip addr show dev eth1 +IPsrcaddr run:false +IPv6addr run:ip addr show dev eth0 && ip addr show dev eth1 +iscsi run:false +jboss run:false +LVM +MailTo +mysql +mysql-proxy run:false +named +nfsserver +oracle prog:sqlplus +pgsql +portblock +postfix +Raid1 +SendArp +sg_persist run:false +tomcat run:false +VirtualDomain run:false +Xen run:false +Xinetd