- from PLD
authorMarcin Krol <hawk@tld-linux.org>
Sun, 19 Jul 2015 12:39:34 +0000 (12:39 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sun, 19 Jul 2015 12:39:34 +0000 (12:39 +0000)
ldirectord.init [new file with mode: 0644]
resource-agents-ac.patch [new file with mode: 0644]
resource-agents-bash.patch [new file with mode: 0644]
resource-agents-no_header_parsing.patch [new file with mode: 0644]
resource-agents.spec [new file with mode: 0644]
resource-agents.tmpfiles [new file with mode: 0644]

diff --git a/ldirectord.init b/ldirectord.init
new file mode 100644 (file)
index 0000000..6cb5d15
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# ldirectord  Linux Director Daemon
+#
+# chkconfig:   345 92 08
+# description: Start and stop ldirectord on non-heartbeat systems \
+#              Using the config file /etc/ha.d/ldirectord.cf \
+#             Normally ldirectord is started and stopped by heartbeat
+#
+# processname: ldirectord
+# config:      /etc/ha.d/ldirectord.cf
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down "ldirectord"
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+# Get service config
+[ -f /etc/sysconfig/ldirectord ] && . /etc/sysconfig/ldirectord
+
+start() {
+       if [ -f /var/lock/subsys/ldirectord ]; then
+               msg_already_running "ldirectord"
+               return
+       fi
+
+       msg_starting "ldirectord"
+       daemon /usr/sbin/ldirectord start
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldirectord
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/ldirectord ]; then
+               msg_not_running "ldirectord"
+               return
+       fi
+
+       msg_stopping ldirectord
+       # XXX, do not use "daemon" to "start", try "action" instead?
+       daemon /usr/sbin/ldirectord stop
+       rm -f /var/lock/subsys/ldirectord
+}
+
+RETVAL=0
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       action "Try-Restarting ldirectord" /usr/sbin/ldirectord try-restart
+       ;;
+  reload|force-reload)
+       if [ -f /var/lock/subsys/ldirectord ]; then
+               msg_reloading "ldirectord"
+               daemon /usr/sbin/ldirectord reload
+               RETVAL=$?
+       else
+               msg_not_running "ldirectord"
+               RETVAL=7
+       fi
+       ;;
+  status)
+       status /usr/sbin/ldirectord status
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|status|reload|force-reload}"
+       exit 3
+       ;;
+esac
+
+exit $RETVAL
diff --git a/resource-agents-ac.patch b/resource-agents-ac.patch
new file mode 100644 (file)
index 0000000..39723a9
--- /dev/null
@@ -0,0 +1,18 @@
+--- ClusterLabs-resource-agents-ac806fd/configure.ac.orig      2013-09-07 15:50:34.699654985 +0200
++++ ClusterLabs-resource-agents-ac806fd/configure.ac   2013-09-07 15:50:52.606320896 +0200
+@@ -23,14 +23,13 @@
+       m4_esyscmd([make/git-version-gen .tarball-version]),
+       [to_be_defined@foobar.org])
+-AC_USE_SYSTEM_EXTENSIONS
+-
+ CRM_DTD_VERSION="1.0"
+ PKG_FEATURES=""
+ AC_CONFIG_AUX_DIR(.)
+ AC_CANONICAL_HOST
++AC_USE_SYSTEM_EXTENSIONS
+ dnl Where #defines go (e.g. `AC_CHECK_HEADERS' below)
+ dnl
diff --git a/resource-agents-bash.patch b/resource-agents-bash.patch
new file mode 100644 (file)
index 0000000..a583bc9
--- /dev/null
@@ -0,0 +1,62 @@
+diff -dur -x '*~' ClusterLabs-resource-agents-2fafa06.orig/heartbeat/CTDB ClusterLabs-resource-agents-2fafa06/heartbeat/CTDB
+--- ClusterLabs-resource-agents-2fafa06.orig/heartbeat/CTDB    2012-05-25 18:23:59.000000000 +0200
++++ ClusterLabs-resource-agents-2fafa06/heartbeat/CTDB 2012-10-30 13:48:13.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ #             OCF Resource Agent for managing CTDB
+ #
+diff -dur -x '*~' ClusterLabs-resource-agents-2fafa06.orig/heartbeat/Xen ClusterLabs-resource-agents-2fafa06/heartbeat/Xen
+--- ClusterLabs-resource-agents-2fafa06.orig/heartbeat/Xen     2012-05-25 18:23:59.000000000 +0200
++++ ClusterLabs-resource-agents-2fafa06/heartbeat/Xen  2012-10-30 13:48:27.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ #
+ # Support:      linux-ha@lists.linux-ha.org
+diff -dur -x '*~' ClusterLabs-resource-agents-2fafa06.orig/heartbeat/apache ClusterLabs-resource-agents-2fafa06/heartbeat/apache
+--- ClusterLabs-resource-agents-2fafa06.orig/heartbeat/apache  2012-05-25 18:23:59.000000000 +0200
++++ ClusterLabs-resource-agents-2fafa06/heartbeat/apache       2012-10-30 13:48:43.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ #     High-Availability Apache/IBMhttp control script
+ # 
+diff -dur -x '*~' ClusterLabs-resource-agents-2fafa06.orig/heartbeat/dhcpd ClusterLabs-resource-agents-2fafa06/heartbeat/dhcpd
+--- ClusterLabs-resource-agents-2fafa06.orig/heartbeat/dhcpd   2012-05-25 18:23:59.000000000 +0200
++++ ClusterLabs-resource-agents-2fafa06/heartbeat/dhcpd        2012-10-30 13:47:07.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ #   Resource Agent for managing dhcpd resources.
+ #
+diff -dur -x '*~' ClusterLabs-resource-agents-2fafa06.orig/heartbeat/exportfs ClusterLabs-resource-agents-2fafa06/heartbeat/exportfs
+--- ClusterLabs-resource-agents-2fafa06.orig/heartbeat/exportfs        2012-05-25 18:23:59.000000000 +0200
++++ ClusterLabs-resource-agents-2fafa06/heartbeat/exportfs     2012-10-30 13:48:52.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # exportfs
+ #
+ # Description: Manages nfs exported file system.
+diff -dur -x '*~' ClusterLabs-resource-agents-2fafa06.orig/heartbeat/nginx ClusterLabs-resource-agents-2fafa06/heartbeat/nginx
+--- ClusterLabs-resource-agents-2fafa06.orig/heartbeat/nginx   2012-05-25 18:23:59.000000000 +0200
++++ ClusterLabs-resource-agents-2fafa06/heartbeat/nginx        2012-10-30 13:49:01.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ #     High-Availability nginx OCF resource agent
+ # 
+--- ClusterLabs-resource-agents-ac806fd/heartbeat/tomcat.orig  2013-02-07 13:17:42.000000000 +0100
++++ ClusterLabs-resource-agents-ac806fd/heartbeat/tomcat       2013-09-07 15:05:43.176434602 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Description:  Manages a Tomcat Server as an OCF High-Availability
+ #               resource under Heartbeat/LinuxHA control
diff --git a/resource-agents-no_header_parsing.patch b/resource-agents-no_header_parsing.patch
new file mode 100644 (file)
index 0000000..71c109d
--- /dev/null
@@ -0,0 +1,15 @@
+--- ClusterLabs-resource-agents-b735277/configure.ac~  2011-06-29 14:51:48.000000000 +0200
++++ ClusterLabs-resource-agents-b735277/configure.ac   2012-07-04 18:29:56.185645216 +0200
+@@ -366,12 +366,6 @@
+ AC_CHECK_HEADERS(heartbeat/glue_config.h)
+-if test "$ac_cv_header_heartbeat_glue_config_h" = "yes"; then
+-  OCF_ROOT_DIR=`extract_header_define heartbeat/glue_config.h OCF_ROOT_DIR`
+-else
+-  enable_libnet=no
+-fi
+-
+ AC_DEFINE_UNQUOTED(OCF_ROOT_DIR,"$OCF_ROOT_DIR", OCF root directory - specified by the OCF standard)
+ AC_SUBST(OCF_ROOT_DIR)
diff --git a/resource-agents.spec b/resource-agents.spec
new file mode 100644 (file)
index 0000000..0431c90
--- /dev/null
@@ -0,0 +1,186 @@
+%include       /usr/lib/rpm/macros.perl
+Summary:       Reusable cluster resource scripts
+Summary(pl.UTF-8):     Skrypty wielokrotnego użytku do obsługi zasobów klastrowych
+Name:          resource-agents
+Version:       3.9.5
+Release:       2
+License:       GPL v2+, LGPL v2.1+
+Group:         Daemons
+Source0:       https://github.com/ClusterLabs/resource-agents/tarball/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 86ec112decf29906afb755016990f56f
+Source1:       ldirectord.init
+Source2:       %{name}.tmpfiles
+Patch0:                %{name}-no_header_parsing.patch
+Patch1:                %{name}-bash.patch
+Patch2:                %{name}-ac.patch
+URL:           http://www.linux-ha.org/
+BuildRequires: autoconf >= 2.63
+BuildRequires: automake >= 1:1.10.1
+BuildRequires: cluster-glue-libs-devel
+BuildRequires: docbook-dtd44-xml
+BuildRequires: docbook-style-xsl
+BuildRequires: glib2-devel >= 2.0
+BuildRequires: libnet-devel >= 1.0
+BuildRequires: libtool
+BuildRequires: libxslt-progs
+BuildRequires: openssl-tools
+BuildRequires: perl-tools-pod
+BuildRequires: pkgconfig
+BuildRequires: python-devel
+BuildRequires: rpm-perlprov
+BuildRequires: which
+Requires:      cluster-glue
+Obsoletes:     heartbeat-resources < 3.0
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Scripts to allow common services to operate in a High Availability
+environment.
+
+%description -l pl.UTF-8
+Skrypty pozwalające na działanie popularnych usług w środowisku
+wysokiej dostępności (High Availability).
+
+%package -n ldirectord
+Summary:       A Monitoring Daemon for Maintaining High Availability Resources
+Summary(pl.UTF-8):     Demon monitorujący do utrzymywania zasobów z wysoką dostępnością
+License:       GPL v2+
+Group:         Applications/System
+Requires(post,preun):  /sbin/chkconfig
+Requires:      ipvsadm
+Requires:      rc-scripts
+Provides:      heartbeat-ldirectord
+Obsoletes:     heartbeat-ldirectord
+
+%description -n ldirectord
+The Linux Director Daemon (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 the heartbeat code (http://www.linux-ha.org/).
+
+%description -n ldirectord -l pl.UTF-8
+Demon Linux Director (ldirectord) to samodzielny demon do
+monitorowania usług na rzeczywistych serwerach. Obecnie obsługiwane są
+usługi HTTP, HTTPS i FTP. ldirectord jest prosty do zainstalowania i
+współpracuje z kodem heartbeat (http://www.linux-ha.org/).
+
+%prep
+%setup -q -n ClusterLabs-%{name}-ac806fd
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+       FSCK=/sbin/fsck \
+       FUSER=/bin/fuser \
+       IPTABLES=%{_sbindir}/iptables \
+       MAILCMD=/bin/mail \
+       MOUNT=/bin/mount \
+       PING=/bin/ping \
+       --docdir=%{_docdir}/%{name}-%{version} \
+       --enable-fatal-warnings \
+       --with-initdir=/etc/rc.d/init.d \
+       --with-ocf-root=%{_prefix}/lib/ocf
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d \
+       $RPM_BUILD_ROOT%{systemdtmpfilesdir}
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+# in doc
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/ra-api-1.dtd
+
+%{__rm} $RPM_BUILD_ROOT/etc/rc.d/init.d/ldirectord
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ldirectord
+cp -a ldirectord/ldirectord.cf $RPM_BUILD_ROOT%{_sysconfdir}/ha.d
+install %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
+
+# Unset execute permissions from things that shouln't have it
+find $RPM_BUILD_ROOT%{_datadir} -name 'ocf-*'  -type f -print0 | xargs -0 chmod a-x
+
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post  -n ldirectord
+/sbin/chkconfig --add ldirectord
+%service ldirectord restart
+
+%preun -n ldirectord
+if [ "$1" = "0" ]; then
+       %service -q ldirectord stop
+       /sbin/chkconfig --del ldirectord
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog doc/README.webapps heartbeat/ra-api-1.dtd
+%attr(755,root,root) %{_sbindir}/ocf-tester
+%attr(755,root,root) %{_sbindir}/ocft
+%attr(755,root,root) %{_sbindir}/sfex_init
+%attr(755,root,root) %{_sbindir}/sfex_stat
+%attr(755,root,root) %{_sbindir}/rhev-check.sh
+
+%dir %{_sysconfdir}/ha.d
+%dir %{_sysconfdir}/ha.d/resource.d
+%{_sysconfdir}/ha.d/shellfuncs
+
+%attr(755,root,root) %{_libdir}/heartbeat/send_arp
+%attr(755,root,root) %{_libdir}/heartbeat/send_ua
+%attr(755,root,root) %{_libdir}/heartbeat/sfex_daemon
+%attr(755,root,root) %{_libdir}/heartbeat/findif
+%attr(755,root,root) %{_libdir}/heartbeat/tickle_tcp
+
+%dir %{_prefix}/lib/ocf
+%dir %{_prefix}/lib/ocf/lib
+%dir %{_prefix}/lib/ocf/lib/heartbeat
+%{_prefix}/lib/ocf/lib/heartbeat/ocf-*
+%{_prefix}/lib/ocf/lib/heartbeat/*.sh
+%dir %{_prefix}/lib/ocf/resource.d
+%dir %{_prefix}/lib/ocf/resource.d/heartbeat
+%{_prefix}/lib/ocf/resource.d/heartbeat/.ocf-*
+%attr(755,root,root) %{_prefix}/lib/ocf/resource.d/heartbeat/*
+%{_prefix}/lib/ocf/resource.d/redhat
+
+%dir %{_datadir}/cluster
+%{_datadir}/cluster/*.metadata
+%attr(755,root,root) %{_datadir}/cluster/*.sh
+%{_datadir}/cluster/SAP*
+%{_datadir}/cluster/svclib_nfslock
+%{_datadir}/cluster/ocf-shellfuncs
+%dir %{_datadir}/cluster/relaxng
+%{_datadir}/cluster/relaxng/*
+%dir %{_datadir}/cluster/utils
+%attr(755,root,root) %{_datadir}/cluster/utils/*
+
+%{_datadir}/resource-agents
+
+%{_includedir}/heartbeat/agent_config.h
+
+%attr(1755,root,root) /var/run/resource-agents
+%{systemdtmpfilesdir}/%{name}.conf
+
+%{_mandir}/man7/ocf_heartbeat_*.7*
+%{_mandir}/man8/ocf-tester.8*
+%{_mandir}/man8/sfex_init.8*
+
+%files -n ldirectord
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ha.d/ldirectord.cf
+%attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/ldirectord
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/ldirectord
+%attr(754,root,root) /etc/rc.d/init.d/ldirectord
+%attr(755,root,root) %{_sbindir}/ldirectord
+%{_mandir}/man8/ldirectord.8*
diff --git a/resource-agents.tmpfiles b/resource-agents.tmpfiles
new file mode 100644 (file)
index 0000000..a72eeeb
--- /dev/null
@@ -0,0 +1 @@
+d /var/run/resource-agents 1755 root root -