From da8cf4d9f68bfd02e95bf391082cc33ca84f277d Mon Sep 17 00:00:00 2001 From: Roman I Khimov Date: Tue, 23 Mar 2010 17:27:27 +0300 Subject: [PATCH] pacemaker: new recipe Pacemaker achieves maximum availability for your cluster services by detecting and recovering from node and service-level failures. It achieves this by utilizing the messaging and membership capabilities provided by your preferred cluster infrastructure (OE version is built for OpenAIS). If the startup and shutdown of your service can scripted, Pacemaker can improve its availability. Pacemaker can manage clusters of practically any size and comes with a powerful dependency model for accurately modeling your environment. Signed-off-by: Roman I Khimov --- recipes/pacemaker/files/volatiles | 7 ++ .../pacemaker-dont-use-help2man.patch | 16 ++++ .../pacemaker-remove-native-includes.patch | 22 ++++++ recipes/pacemaker/pacemaker_1.0.8.bb | 73 +++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 recipes/pacemaker/files/volatiles create mode 100644 recipes/pacemaker/pacemaker-1.0.8/pacemaker-dont-use-help2man.patch create mode 100644 recipes/pacemaker/pacemaker-1.0.8/pacemaker-remove-native-includes.patch create mode 100644 recipes/pacemaker/pacemaker_1.0.8.bb diff --git a/recipes/pacemaker/files/volatiles b/recipes/pacemaker/files/volatiles new file mode 100644 index 0000000000..50a55be8f4 --- /dev/null +++ b/recipes/pacemaker/files/volatiles @@ -0,0 +1,7 @@ +d hacluster haclient 0750 /var/lib/heartbeat/crm none +d hacluster haclient 0755 /var/lib/pengine none +d hacluster haclient 0755 /var/run/heartbeat none +d hacluster haclient 0755 /var/run/heartbeat/rsctmp none +d hacluster haclient 0755 /var/run/crm none + + diff --git a/recipes/pacemaker/pacemaker-1.0.8/pacemaker-dont-use-help2man.patch b/recipes/pacemaker/pacemaker-1.0.8/pacemaker-dont-use-help2man.patch new file mode 100644 index 0000000000..da970d5079 --- /dev/null +++ b/recipes/pacemaker/pacemaker-1.0.8/pacemaker-dont-use-help2man.patch @@ -0,0 +1,16 @@ +Index: Pacemaker-1-0-Pacemaker-1.0.8/configure.ac +=================================================================== +--- Pacemaker-1-0-Pacemaker-1.0.8.orig/configure.ac 2010-03-23 12:03:29.000000000 +0300 ++++ Pacemaker-1-0-Pacemaker-1.0.8/configure.ac 2010-03-23 12:06:43.000000000 +0300 +@@ -504,10 +504,7 @@ + AC_MSG_ERROR(You need (g)make installed in order to build ${PACKAGE}) + fi + +-AM_CONDITIONAL(BUILD_HELP, test x"${HELP2MAN}" != x"") +-if test x"${HELP2MAN}" != x""; then +- PKG_FEATURES="$PKG_FEATURES manpages" +-fi ++AM_CONDITIONAL(BUILD_HELP, test x"" != x"") + + AM_CONDITIONAL(BUILD_ASCIIDOC, test x"${ASCIIDOC}" != x"") + if test x"${ASCIIDOC}" != x""; then diff --git a/recipes/pacemaker/pacemaker-1.0.8/pacemaker-remove-native-includes.patch b/recipes/pacemaker/pacemaker-1.0.8/pacemaker-remove-native-includes.patch new file mode 100644 index 0000000000..a16854024c --- /dev/null +++ b/recipes/pacemaker/pacemaker-1.0.8/pacemaker-remove-native-includes.patch @@ -0,0 +1,22 @@ +Index: Pacemaker-1-0-Pacemaker-1.0.8/configure.ac +=================================================================== +--- Pacemaker-1-0-Pacemaker-1.0.8.orig/configure.ac 2010-03-16 22:46:38.000000000 +0300 ++++ Pacemaker-1-0-Pacemaker-1.0.8/configure.ac 2010-03-23 00:06:28.000000000 +0300 +@@ -325,7 +325,6 @@ + ;; + *linux*) + AC_DEFINE_UNQUOTED(ON_LINUX, 1, Compiling for Linux platform) +- CFLAGS="$CFLAGS -I${prefix}/include" + ;; + darwin*) + AC_DEFINE_UNQUOTED(ON_DARWIN, 1, Compiling for Darwin platform) +@@ -334,9 +333,6 @@ + ;; + esac + +-dnl Eventually remove this +-CFLAGS="$CFLAGS -I${prefix}/include/heartbeat" +- + AC_SUBST(INIT_EXT) + AC_DEFINE_UNQUOTED(HA_LOG_FACILITY, LOG_DAEMON, Default logging facility) + diff --git a/recipes/pacemaker/pacemaker_1.0.8.bb b/recipes/pacemaker/pacemaker_1.0.8.bb new file mode 100644 index 0000000000..265ea30a60 --- /dev/null +++ b/recipes/pacemaker/pacemaker_1.0.8.bb @@ -0,0 +1,73 @@ +DESCRIPTION = "Scalable High-Availability cluster resource manager" +LICENSE = "GPL" +DEPENDS = " \ + bzip2 \ + cluster-glue \ + cluster-resource-agents \ + glib-2.0 \ + gnutls \ + libxml2 \ + libxslt \ + ncurses \ + openais \ + python-native \ + util-linux-ng \ + zlib \ + " +RDEPENDS_${PN} += "openais" + +SRC_URI = " \ + http://hg.clusterlabs.org/pacemaker/stable-1.0/archive/Pacemaker-${PV}.tar.bz2;name=tar \ + file://pacemaker-remove-native-includes.patch;patch=1 \ + file://pacemaker-dont-use-help2man.patch;patch=1 \ + file://volatiles \ + " +SRC_URI[tar.md5sum] = "088569ca893fe9f2239b68abe2856132" +SRC_URI[tar.sha256sum] = "07e2e5559720890603baac96aa7635ff02f0b33ead592977554e661c6afe7b55" +inherit autotools_stage python-dir + +S = "${WORKDIR}/Pacemaker-1-0-Pacemaker-${PV}" + +EXTRA_OECONF = "--with-ais --without-heartbeat --disable-fatal-warnings --disable-pretty" + +CFLAGS += "-I${STAGING_INCDIR}/heartbeat" + +do_install_append() { + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/06_pacemaker + find ${D} -name "*.pyo" -exec rm {} \; + find ${D} -name "*.pyc" -exec rm {} \; + find ${D} -name "*.py" | xargs sed -i -e "s:${STAGING_BINDIR_NATIVE}:${bindir}:g" +} + +pkg_postinst_${PN} () { + set -e + grep haclient /etc/group || addgroup haclient + grep hacluster /etc/passwd || adduser --disabled-password --home=${localstatedir}/lib/heartbeat --ingroup haclient -g "HA cluster" hacluster + /etc/init.d/populate-volatile.sh update +} + +FILES_${PN} += " \ + ${libdir}/service_crm.so \ + ${libdir}/ocf/resource.d/pacemaker \ + ${libdir}/heartbeat/a* \ + ${libdir}/heartbeat/c* \ + ${libdir}/heartbeat/pengine \ + ${libdir}/heartbeat/pingd \ + ${libdir}/heartbeat/plugins/RAExec/stonith.so \ + ${libdir}/heartbeat/s* \ + " +FILES_${PN}-dbg += "${libdir}/heartbeat/.debug ${libdir}/heartbeat/plugins/RAExec/.debug/ ${libdir}/heartbeat/stonithdtest/.debug/ ${libexecdir}/lcrso/.debug" +FILES_${PN}-dev += "${libdir}/heartbeat/plugins/RAExec/*.la" +FILES_${PN}-static += "${libdir}/heartbeat/plugins/RAExec/*.a" + +PACKAGES =+ "${PN}-crm ${PN}-hb2openais ${PN}-haresources2cib ${PN}-tests ${PN}-snmp" +FILES_${PN}-crm = "${sbindir}/crm ${PYTHON_SITEPACKAGES_DIR} ${libdir}/heartbeat/crm_primitive.py " +RDEPENDS_${PN}-crm += "python-core" +FILES_${PN}-hb2openais = "${libdir}/heartbeat/hb2openais.sh ${libdir}/heartbeat/hb2openais-helper.py" +RDEPENDS_${PN}-hb2openais += "python-core" +FILES_${PN}-haresources2cib = "${libdir}/heartbeat/haresources2cib.py" +RDEPENDS_${PN}-haresources2cib += "python-core" +FILES_${PN}-tests = "${datadir}/pacemaker/tests" +RDEPENDS_${PN}-test += "python-core" +FILES_${PN}-snmp = "${datadir}/snmp/mibs/PCMK-MIB.txt" -- 2.39.5