diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-cluster/pacemaker |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-cluster/pacemaker')
-rw-r--r-- | sys-cluster/pacemaker/Manifest | 15 | ||||
-rw-r--r-- | sys-cluster/pacemaker/files/pacemaker-1.1.10-tinfo.patch | 21 | ||||
-rw-r--r-- | sys-cluster/pacemaker/files/pacemaker-1.1.12-glib.patch | 47 | ||||
-rw-r--r-- | sys-cluster/pacemaker/files/pacemaker-1.1.12-stonith.patch | 21 | ||||
-rw-r--r-- | sys-cluster/pacemaker/files/pacemaker.initd | 41 | ||||
-rw-r--r-- | sys-cluster/pacemaker/files/pacemaker.service | 5 | ||||
-rw-r--r-- | sys-cluster/pacemaker/files/ping | 380 | ||||
-rw-r--r-- | sys-cluster/pacemaker/metadata.xml | 21 | ||||
-rw-r--r-- | sys-cluster/pacemaker/pacemaker-1.1.12-r2.ebuild | 100 | ||||
-rw-r--r-- | sys-cluster/pacemaker/pacemaker-1.1.14.ebuild | 94 | ||||
-rw-r--r-- | sys-cluster/pacemaker/pacemaker-1.1.16.ebuild | 78 |
11 files changed, 823 insertions, 0 deletions
diff --git a/sys-cluster/pacemaker/Manifest b/sys-cluster/pacemaker/Manifest new file mode 100644 index 000000000000..b5d71c74980f --- /dev/null +++ b/sys-cluster/pacemaker/Manifest @@ -0,0 +1,15 @@ +AUX pacemaker-1.1.10-tinfo.patch 767 SHA256 5ed6ba9d70df8c288005cf73d9080cd842998485565ba9aa5b62ba69873c0949 SHA512 2418cb275d69e5a589ed5e7aba707719c23bbdae83f2700b4fdabe9df03bf6f6922ef7db6f09b0c06d6d66e8cd661eed37f9c905a5781f865842517a3bd56358 WHIRLPOOL e7e0291140e302fcbd007befaf7ca87ecc2da437ab79cb5bd8db1feee7c58e76d97cabe2296ee29cdcf1d1c3dff2ac572708afa381727201199958b3a7ffb822 +AUX pacemaker-1.1.12-glib.patch 1634 SHA256 577cad59c99929397b45a9e76fa0b15848259bcab40815f7ffad49218b86fdb9 SHA512 11d95e0b85c61b845d9465d1d5dd6ebf2b33a3cba40a89a085fbe4c16eabbc9262546a62fbcdcaab22071de2bbb3967e041527965b61d8bf9a978904128cba0b WHIRLPOOL ea0a481afce1cc2e82deea45c63f1321315cc56c3898174671ccf45c42823f90a330adcd63868cd372eafe3e1e7434636082a666614e24130c686409d81c7947 +AUX pacemaker-1.1.12-stonith.patch 690 SHA256 85e7ce9239b239236eab0aa7d6ba6d3d50c449a9abf954eb31c1d4b244f84e72 SHA512 168811591d18aea99d260c53d4e8307a8c65e0b756f50cd939d05c37697e1c2d0018d3422065add6d126ca23e4fc2371cf8d9f24e68bac2bab74d438112d80d1 WHIRLPOOL c311318f2d5318b778b44e0373954e20ccf661db53f09a9f253b7089dfece178b8566133d3042e449e0ae2284b07bdc1766317ee555eaca0f331ceb8af33b8ae +AUX pacemaker.initd 862 SHA256 0b22c755fa0333f2d72526b5d70549f4fe61c783331e73c86e15c30a433c9e1f SHA512 9578a47ea9271a5b8b5939dc32ff49736504c2e6318f3e9f906b554b1b11a334c01cae8900e946318cdffd3cf9611d748013bdcc63b3ae68919709ebb12e7e7c WHIRLPOOL 915713c85e4061fc20b56082aea3952896e64c3529868a588b897171db5abbef08b21a1f711ddcc946e74a7c91806f80196714594cfa0207c7c4947ab7c561d4 +AUX pacemaker.service 105 SHA256 43034635a3a92ef55bf638ea3e29c2285240228283a70fbd88fe5e28c0d57c8c SHA512 478e1040811f16c0c26fad8feb55cf803e5c4ec4a25e7c82ec771663f25270500fce2dd53622abd7126006c4629bdc3a82fb7f16361eb19543619824a56e848b WHIRLPOOL ec891f83ec9f561060b08bd39e9e0ecf5b243617958bd68f07a2f087a881af85895a4f25f810657ababb6d4541dfcc63e59e195fb6006717dc0cb69a1f869376 +AUX ping 10389 SHA256 021c85d8019b182be7a3603d3363328219ba0b165ea2fe37495dc77d0308f2b4 SHA512 832cd68dab0844b9cee1d1b1453314d42497bc497e97a5cbb78aafbd43b696aa97786b71d1b4d175c1aa8c5f7f240432f1fd4421d16a40ceecdc008d911c0288 WHIRLPOOL 2919972abd1eb4cc78952d39021fcddae07de3f5c193f4872bef07a7745d5d956ba3fff4610f32ef6a107acce6245ad0b8b919585619fe8a03f5436f15b3ce80 +DIST Pacemaker-1.1.12.tar.gz 10459675 SHA256 f5c72b609fac18d362880d120f08f990e8afd9388e6ff86c55cd93900ba54d9c SHA512 cf88a313f5e91f445a159a5d800d27fd891f63c082c92d3f09bfd2aff856325e8ef6e0ebab8c0b2b9cd6eb15cc593c58c8e23e888e17d5286ebc651dd096f9c1 WHIRLPOOL e737d70288936d2f76d310848940bde78537c32e703c68d8dd37a78e54a66dc9d34cf2fe0037f1621fbc5ba10bb9688490da96394cde65f0668d4b62eccf3f03 +DIST Pacemaker-1.1.14.tar.gz 4729808 SHA256 2f73043a5de5e66a47462d37cd68c4c6861f71a03c0ea02eb4ae2b1a550cd7b0 SHA512 81927061bcc0a0b88c472f87a2cbdb26b88a2443b06112cd8c8d58d8491da4e9ae03997108c9d40aa408e80e2998bdc0ac03691f1732d2629c4cef0adcc4b7fa WHIRLPOOL cbae34051a406a9379157fe13171ea8b04c9793528c5f346a7845b2ffa894df4a74fd008e708d99207c6064acf2a39bf569dff0200c47552c0b3b124de00e7eb +DIST Pacemaker-1.1.16.tar.gz 4897772 SHA256 dffcae035975669a66ab545d45216a637496a251ee2114fa03d58acfcc969202 SHA512 967c860fab7b9e73dd8643e6d09083a2a1298a77d71c3b138187803c89153bee7219da13e6b94b20f2881b53ba7fc1c8584a43ff058a265e76708fd5dbccf534 WHIRLPOOL 8beb0188968743d6415c7158790582f01192a643a13246e61cafd6eb8e0d22cd2565dd31e5cfcda04b3aa3e9c749b4c1f0c44bd9419c3fffcc815909e836a92f +EBUILD pacemaker-1.1.12-r2.ebuild 2357 SHA256 a410522c772ca704ef6394ab90ae023c0d1c0667d85ec02d48075a52ce76f761 SHA512 2d1eceed9491e95b2e87b37056ea8b63c1a0fc491ed88a91d4e80a0c79144714392887547f5491ec2c43c9eed272a217fc847097bd5e4dbc6517f8d5b34924f4 WHIRLPOOL 53c34f179b7c6b91b8774115c849606d4618b5b2856b5f6e143c573f6ad30c8029fd1344556791218864e37263d76824f10421139a04b981a7d6617cf2c05a71 +EBUILD pacemaker-1.1.14.ebuild 2197 SHA256 ca8c48d1db3e32fd6cf957af2f96b2d67ac364102cd584b4c177007f3f441c44 SHA512 e39e2084d9a409df027cf3fa9f506e8b5076ac93c6217219d29e19d1b69585ce42094e4873ed8249366abb1b330dd13565a1b0363f5993946fa197ca908ff13c WHIRLPOOL 8a9098b8e876b97678a8b27f4db328e1d0a4aeacff85d8b272be4cf0289388849a6482536ced08259580318cf753b80495916e67f16d026f9a246b031d6f4b0b +EBUILD pacemaker-1.1.16.ebuild 1801 SHA256 8a5fe2a0c9578a03bf10860155e72ff02db8bac532c27d9ad9f4af375620cbbf SHA512 c01c388c60cbd0be7bef5b7df979994fc57cf0ed2ab4b047c6ab64fcc794d8e62b6778871206fc6d2cfbaf191cc75e6aea5c5458ac2442b2d60f92fe2b7d9b53 WHIRLPOOL a3e0bae2bdb0ac005018795aed526aaae9fae388fc035e6ad5deb1bd3edbdfe3e99ab565870675b127d32fdf54a1bf68269712b477d13425da867c238c8cf194 +MISC ChangeLog 3264 SHA256 a9e5b5eb2db190c0d44147947d421342c0c34556cab75432f251e31b6fef8855 SHA512 ce1c6977a6f90f1b56364c468533b91ff101bc0b9ad86fed50ebd77c5d2f61a079507e0c477863095b547aa73641ae245bea553f593f7fe1714f8e4e8bed4262 WHIRLPOOL a77f6cfd51b825f16743a77dc76336734b03089ad5b5d806956816b0d7ea3f71ef3e6aa4275f3d47eb5b6cd34fcb532a3f4d0ea5a215773e5b6d5dfecfebaa2f +MISC ChangeLog-2015 8024 SHA256 7c53f5f74ec8cf5d30d97a1a5ea752524b0b5cdf2a6a48de3fb5382412f23750 SHA512 fe69e97802784a74be5cd102b18ab6e1fac13927a2529e58d5a4035740cef11b8cee857b9fff708aeda614633c73fc903308561db08bbe9f1bde739d358ea0ca WHIRLPOOL 9ab3163a8c0565d19e7854fa3d6454c0955d9076fcbab745555a49fad215b7d57fb99f5c1ce8bbf0b6f086e10cced069f377b7fd5d3ae257af2a892b5a0b4005 +MISC metadata.xml 983 SHA256 181db433b3073e72221ac0b08fa2ea4df98f4de896ac190080daf7752c808fa6 SHA512 0e0f2363d68a4bfb4918b0ca59eca6377c30f6a56a80eb9b12f14a13f59b2a52c3a74ae2152b9866a82b451c75bf14e6040d650733373237c3e9fcc68b38f157 WHIRLPOOL 022877eb7bb335f3215d2b953d6e6ca508b8b4e2644fba29effc4be090a280ccee37d386ed30270b9491b17f21a933b44f4560df1bc4e2795d6a9d5a1b3da1a9 diff --git a/sys-cluster/pacemaker/files/pacemaker-1.1.10-tinfo.patch b/sys-cluster/pacemaker/files/pacemaker-1.1.10-tinfo.patch new file mode 100644 index 000000000000..1dba440c9e79 --- /dev/null +++ b/sys-cluster/pacemaker/files/pacemaker-1.1.10-tinfo.patch @@ -0,0 +1,21 @@ +--- a/configure.ac 2014-12-12 14:13:07.262413254 +0100 ++++ b/configure.ac 2014-12-12 14:13:14.922480835 +0100 +@@ -885,14 +885,16 @@ + CURSESLIBS='' + if test "$ac_cv_header_ncurses_h" = "yes"; then + AC_CHECK_LIB(ncurses, printw, +- [CURSESLIBS='-lncurses'; AC_DEFINE(HAVE_LIBNCURSES,1, have ncurses library)] ++ [AC_DEFINE(HAVE_LIBNCURSES,1, have ncurses library)] + ) ++ CURSESLIBS=`$PKGCONFIG --libs ncurses`; + fi + + if test "$ac_cv_header_ncurses_ncurses_h" = "yes"; then + AC_CHECK_LIB(ncurses, printw, +- [CURSESLIBS='-lncurses'; AC_DEFINE(HAVE_LIBNCURSES,1, have ncurses library)] ++ [AC_DEFINE(HAVE_LIBNCURSES,1, have ncurses library)] + ) ++ CURSESLIBS=`$PKGCONFIG --libs ncurses`; + fi + + dnl Only look for non-n-library if there was no n-library. diff --git a/sys-cluster/pacemaker/files/pacemaker-1.1.12-glib.patch b/sys-cluster/pacemaker/files/pacemaker-1.1.12-glib.patch new file mode 100644 index 000000000000..8233f98a17e8 --- /dev/null +++ b/sys-cluster/pacemaker/files/pacemaker-1.1.12-glib.patch @@ -0,0 +1,47 @@ +From 568e41db929a34106c8c2ff7c48716ab5c13ef49 Mon Sep 17 00:00:00 2001 +From: Andrew Beekhof <andrew@beekhof.net> +Date: Mon, 13 Oct 2014 13:30:58 +1100 +Subject: [PATCH] Fix: lrmd: Prevent glib assert triggered by timers being + removed from mainloop more than once + +--- + lib/services/services.c | 3 +++ + lib/services/services_linux.c | 1 + + 2 files changed, 4 insertions(+) + +--- a/lib/services/services.c ++++ b/lib/services/services.c +@@ -313,6 +313,7 @@ services_action_free(svc_action_t * op) + + if (op->opaque->repeat_timer) { + g_source_remove(op->opaque->repeat_timer); ++ op->opaque->repeat_timer = 0; + } + if (op->opaque->stderr_gsource) { + mainloop_del_fd(op->opaque->stderr_gsource); +@@ -425,6 +426,7 @@ services_action_kick(const char *name, c + } else { + if (op->opaque->repeat_timer) { + g_source_remove(op->opaque->repeat_timer); ++ op->opaque->repeat_timer = 0; + } + recurring_action_timer(op); + return TRUE; +@@ -459,6 +461,7 @@ handle_duplicate_recurring(svc_action_t + if (dup->pid != 0) { + if (op->opaque->repeat_timer) { + g_source_remove(op->opaque->repeat_timer); ++ op->opaque->repeat_timer = 0; + } + recurring_action_timer(dup); + } +--- a/lib/services/services_linux.c ++++ b/lib/services/services_linux.c +@@ -226,6 +226,7 @@ recurring_action_timer(gpointer data) + op->stdout_data = NULL; + free(op->stderr_data); + op->stderr_data = NULL; ++ op->opaque->repeat_timer = 0; + + services_action_async(op, NULL); + return FALSE; diff --git a/sys-cluster/pacemaker/files/pacemaker-1.1.12-stonith.patch b/sys-cluster/pacemaker/files/pacemaker-1.1.12-stonith.patch new file mode 100644 index 000000000000..31c729559f35 --- /dev/null +++ b/sys-cluster/pacemaker/files/pacemaker-1.1.12-stonith.patch @@ -0,0 +1,21 @@ +Description: Fix: stonith-ng: Reset mainloop source IDs after removing them + +Origin: upstream, commit: 0326f05c9e26f39a394fa30830e31a76306f49c7 +Author: Andrew Beekhof <andrew@beekhof.net> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1412962 +Last-Update: 2015-01-20 + +--- a/lib/fencing/st_client.c ++++ b/lib/fencing/st_client.c +@@ -663,9 +663,11 @@ stonith_action_async_done(mainloop_child + + if (action->timer_sigterm > 0) { + g_source_remove(action->timer_sigterm); ++ action->timer_sigterm = 0; + } + if (action->timer_sigkill > 0) { + g_source_remove(action->timer_sigkill); ++ action->timer_sigkill = 0; + } + + if (action->last_timeout_signo) { diff --git a/sys-cluster/pacemaker/files/pacemaker.initd b/sys-cluster/pacemaker/files/pacemaker.initd new file mode 100644 index 000000000000..8dbcea6ce37d --- /dev/null +++ b/sys-cluster/pacemaker/files/pacemaker.initd @@ -0,0 +1,41 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE=/var/run/pacemaker.pid + +depend() { + need net corosync + use syslog +} + +start() { + nc=0 + ebegin "Starting Pacemaker Cluster Manager" + + checkpath -d -m 0750 -o hacluster:haclient /var/run/crm + + einfon "Waiting for Corosync startup ." + while true; do + /usr/sbin/corosync-cfgtool -s &>/dev/null && break + nc=$(expr $nc + 1) + if [ $nc -gt 30 ]; then + echo + eend 1 "Failed to detect Corosync startup, is it really running ?" + exit 1 + fi + sleep 1 + echo -n "." + done + echo + start-stop-daemon --start -q --exec /usr/sbin/pacemakerd \ + --pidfile "${PIDFILE}" --make-pidfile --background \ + -- -f + eend $? +} + +stop() { + ebegin "Stopping Pacemaker Cluster Manager" + start-stop-daemon --stop -q --pidfile "${PIDFILE}" + eend $? +} diff --git a/sys-cluster/pacemaker/files/pacemaker.service b/sys-cluster/pacemaker/files/pacemaker.service new file mode 100644 index 000000000000..6383499ba923 --- /dev/null +++ b/sys-cluster/pacemaker/files/pacemaker.service @@ -0,0 +1,5 @@ +service { + # Load the Pacemaker Cluster Resource Manager + name: pacemaker + ver: 1 +}
\ No newline at end of file diff --git a/sys-cluster/pacemaker/files/ping b/sys-cluster/pacemaker/files/ping new file mode 100644 index 000000000000..52c4c3d4cad8 --- /dev/null +++ b/sys-cluster/pacemaker/files/ping @@ -0,0 +1,380 @@ +#!/bin/sh +# +# +# Ping OCF RA that utilizes the system ping +# +# Copyright (c) 2009 Andrew Beekhof +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +# + +####################################################################### +# Initialization: + +: ${OCF_FUNCTIONS=${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs} +. ${OCF_FUNCTIONS} +: ${__OCF_ACTION=$1} + +####################################################################### + +meta_data() { + cat <<END +<?xml version="1.0"?> +<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> +<resource-agent name="ping"> +<version>1.0</version> + +<longdesc lang="en"> +Every time the monitor action is run, this resource agent records (in the CIB) the current number of ping nodes the host can connect to. +It is essentially the same as pingd except that it uses the system ping tool to obtain the results. +</longdesc> +<shortdesc lang="en">node connectivity</shortdesc> + +<parameters> + +<parameter name="pidfile" unique="0"> +<longdesc lang="en">PID file</longdesc> +<shortdesc lang="en">PID file</shortdesc> +<content type="string" default="$HA_VARRUN/ping-${OCF_RESOURCE_INSTANCE}" /> +</parameter> + +<parameter name="dampen" unique="0"> +<longdesc lang="en"> +The time to wait (dampening) further changes occur +</longdesc> +<shortdesc lang="en">Dampening interval</shortdesc> +<content type="integer" default="5s"/> +</parameter> + +<parameter name="name" unique="0"> +<longdesc lang="en"> +The name of the attributes to set. This is the name to be used in the constraints. +</longdesc> +<shortdesc lang="en">Attribute name</shortdesc> +<content type="string" default="pingd"/> +</parameter> + +<parameter name="multiplier" unique="0"> +<longdesc lang="en"> +The number by which to multiply the number of connected ping nodes by +</longdesc> +<shortdesc lang="en">Value multiplier</shortdesc> +<content type="integer" default=""/> +</parameter> + +<parameter name="host_list" unique="0" required="1"> +<longdesc lang="en"> +The list of ping nodes to count. +</longdesc> +<shortdesc lang="en">Host list</shortdesc> +<content type="string" default=""/> +</parameter> + +<parameter name="attempts" unique="0"> +<longdesc lang="en"> +Number of ping attempts, per host, before declaring it dead +</longdesc> +<shortdesc lang="en">no. of ping attempts</shortdesc> +<content type="integer" default="2"/> +</parameter> + +<parameter name="timeout" unique="0"> +<longdesc lang="en"> +How long, in seconds, to wait before declaring a ping lost +</longdesc> +<shortdesc lang="en">ping timeout in seconds</shortdesc> +<content type="integer" default="2"/> +</parameter> + +<parameter name="options" unique="0"> +<longdesc lang="en"> +A catch all for any other options that need to be passed to ping. +</longdesc> +<shortdesc lang="en">Extra Options</shortdesc> +<content type="string" default=""/> +</parameter> + +<parameter name="failure_score" unique="0"> +<longdesc lang="en"> +Resource is failed if the score is less than failure_score. +Default never fails. +</longdesc> +<shortdesc lang="en">failure_score</shortdesc> +<content type="integer" default=""/> +</parameter> + +<parameter name="debug" unique="0"> +<longdesc lang="en"> +Enables to use default attrd_updater verbose logging on every call. +</longdesc> +<shortdesc lang="en">Verbose logging</shortdesc> +<content type="string" default="false"/> +</parameter> + +</parameters> + +<actions> +<action name="start" timeout="60" /> +<action name="stop" timeout="20" /> +<action name="reload" timeout="100" /> +<action name="monitor" depth="0" timeout="60" interval="10"/> +<action name="meta-data" timeout="5" /> +<action name="validate-all" timeout="30" /> +</actions> +</resource-agent> +END +} + +####################################################################### + +ping_conditional_log() { + level=$1; shift + if [ ${OCF_RESKEY_debug} = "true" ]; then + ocf_log $level "$*" + fi +} + +ping_usage() { + cat <<END +usage: $0 {start|stop|monitor|migrate_to|migrate_from|validate-all|meta-data} + +Expects to have a fully populated OCF RA-compliant environment set. +END +} + +ping_start() { + ping_monitor + if [ $? = $OCF_SUCCESS ]; then + return $OCF_SUCCESS + fi + touch ${OCF_RESKEY_pidfile} + ping_update +} + +ping_stop() { + + rm -f ${OCF_RESKEY_pidfile} + + attrd_updater -D -n $OCF_RESKEY_name -d $OCF_RESKEY_dampen $attrd_options + + return $OCF_SUCCESS +} + +ping_monitor() { + if [ -f ${OCF_RESKEY_pidfile} ]; then + ping_update + if [ $? -eq 0 ]; then + return $OCF_SUCCESS + fi + return $OCF_ERR_GENERIC + fi + return $OCF_NOT_RUNNING +} + +ping_validate() { + # Is the state directory writable? + state_dir=`dirname "$OCF_RESKEY_pidfile"` + touch "$state_dir/$$" + if [ $? != 0 ]; then + ocf_log err "Invalid location for 'state': $state_dir is not writable" + return $OCF_ERR_ARGS + fi + rm "$state_dir/$$" + +# Pidfile better be an absolute path + case $OCF_RESKEY_pidfile in + /*) ;; + *) ocf_log warn "You should use an absolute path for pidfile not: $OCF_RESKEY_pidfile" ;; + esac + +# Check the host list + if [ "x" = "x$OCF_RESKEY_host_list" ]; then + ocf_log err "Empty host_list. Please specify some nodes to ping" + exit $OCF_ERR_CONFIGURED + fi + + check_binary ping + + return $OCF_SUCCESS +} + + +fping_check() { + active=0 + f_out=`mktemp` + f_err=`mktemp` + + n=$OCF_RESKEY_attempts + timeout=`expr $OCF_RESKEY_timeout \* 1000 / $OCF_RESKEY_attempts` + + cmd="fping -r $OCF_RESKEY_attempts -t $timeout -B 1.0 $OCF_RESKEY_host_list" + $cmd>$f_out 2>$f_err; rc=$? + active=`grep alive $f_out|wc -l` + + case $rc in + 0) + ;; + 1) + for h in `grep unreachable $f_out | awk '{print $1}'`; do + ping_conditional_log warn "$h is inactive" + done + ;; + *) + ocf_log err "Unexpected result for '$cmd' $rc: `tr '\n' ';' < $f_err`" + ;; + esac + rm -f $f_out $f_err + + return $active +} + +ping_check() { + active=0 + for host in $OCF_RESKEY_host_list; do + p_exe=ping + + case `uname` in + Linux) p_args="-n -q -W $OCF_RESKEY_timeout -c $OCF_RESKEY_attempts";; + Darwin) p_args="-n -q -t $OCF_RESKEY_timeout -c $OCF_RESKEY_attempts -o";; + *) ocf_log err "Unknown host type: `uname`"; exit $OCF_ERR_INSTALLED;; + esac + + case $host in + *:*) p_exe=ping6 + esac + + p_out=`$p_exe $p_args $OCF_RESKEY_options $host 2>&1`; rc=$? + + case $rc in + 0) active=`expr $active + 1`;; + 1) ping_conditional_log warn "$host is inactive: $p_out";; + *) ocf_log err "Unexpected result for '$p_exe $p_args $OCF_RESKEY_options $host' $rc: $p_out";; + esac + done + return $active +} + +ping_update() { + + if have_binary fping; then + fping_check + active=$? + else + ping_check + active=$? + fi + + score=`expr $active \* $OCF_RESKEY_multiplier` + attrd_updater -n $OCF_RESKEY_name -v $score -d $OCF_RESKEY_dampen $attrd_options + rc=$? + case $rc in + 0) ping_conditional_log debug "Updated $OCF_RESKEY_name = $score" ;; + *) ocf_log warn "Could not update $OCF_RESKEY_name = $score: rc=$rc";; + esac + if [ $rc -ne 0 ]; then + return $rc + fi + + if [ -n "$OCF_RESKEY_failure_score" -a "$score" -lt "$OCF_RESKEY_failure_score" ]; then + ocf_log warn "$OCF_RESKEY_name is less than failure_score($OCF_RESKEY_failure_score)" + return 1 + fi + return 0 +} + +: ${OCF_RESKEY_name:="pingd"} +: ${OCF_RESKEY_dampen:="5s"} +: ${OCF_RESKEY_attempts:="3"} +: ${OCF_RESKEY_multiplier:="1"} +: ${OCF_RESKEY_debug:="false"} +: ${OCF_RESKEY_failure_score:="0"} + +: ${OCF_RESKEY_CRM_meta_timeout:="20000"} +: ${OCF_RESKEY_CRM_meta_globally_unique:="true"} + +integer=`echo ${OCF_RESKEY_timeout} | egrep -o '[0-9]*'` +case ${OCF_RESKEY_timeout} in + *[0-9]ms|*[0-9]msec) OCF_RESKEY_timeout=`expr $integer / 1000`;; + *[0-9]m|*[0-9]min) OCF_RESKEY_timeout=`expr $integer \* 60`;; + *[0-9]h|*[0-9]hr) OCF_RESKEY_timeout=`expr $integer \* 60 \* 60`;; + *) OCF_RESKEY_timeout=$integer;; +esac + +if [ -z ${OCF_RESKEY_timeout} ]; then + if [ x"$OCF_RESKEY_host_list" != x ]; then + host_count=`echo $OCF_RESKEY_host_list | awk '{print NF}'` + OCF_RESKEY_timeout=`expr $OCF_RESKEY_CRM_meta_timeout / $host_count / $OCF_RESKEY_attempts` + OCF_RESKEY_timeout=`expr $OCF_RESKEY_timeout / 1100` # Convert to seconds and finish 10% early + else + OCF_RESKEY_timeout=5 + fi +fi + +if [ ${OCF_RESKEY_timeout} -lt 1 ]; then + OCF_RESKEY_timeout=5 +elif [ ${OCF_RESKEY_timeout} -gt 1000 ]; then + # ping actually complains if this value is too high, 5 minutes is plenty + OCF_RESKEY_timeout=300 +fi + +if [ ${OCF_RESKEY_CRM_meta_globally_unique} = "false" ]; then + : ${OCF_RESKEY_pidfile:="$HA_VARRUN/ping-${OCF_RESKEY_name}"} +else + : ${OCF_RESKEY_pidfile:="$HA_VARRUN/ping-${OCF_RESOURCE_INSTANCE}"} +fi + +case $__OCF_ACTION in + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + ping_usage + exit $OCF_SUCCESS + ;; +esac + +attrd_options='-q' +if ocf_is_true ${OCF_RESKEY_debug} ; then + attrd_options='' +fi + +# Check the debug option + case "${OCF_RESKEY_debug}" in + true|True|TRUE|1) OCF_RESKEY_debug=true;; + false|False|FALSE|0) OCF_RESKEY_debug=false;; + *) + ocf_log warn "Value for 'debug' is incorrect. Please specify 'true' or 'false' not: ${OCF_RESKEY_debug}" + OCF_RESKEY_debug=false + ;; + esac + +case $__OCF_ACTION in +start) ping_start;; +stop) ping_stop;; +monitor) ping_monitor;; +reload) ping_start;; +validate-all) ping_validate;; +*) ping_usage + exit $OCF_ERR_UNIMPLEMENTED + ;; +esac +exit $? diff --git a/sys-cluster/pacemaker/metadata.xml b/sys-cluster/pacemaker/metadata.xml new file mode 100644 index 000000000000..c486adbd93a7 --- /dev/null +++ b/sys-cluster/pacemaker/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>cluster@gentoo.org</email> + <name>Gentoo Cluster Project</name> + </maintainer> + <longdescription>Pacemaker is a cluster resource manager. + It achieves maximum availability for your cluster services (aka. resources) by detecting and + recovering from node and resource-level failures by making use of the messaging and membership + capabilities provided by your preferred cluster infrastructure (either OpenAIS or Heartbeat). + </longdescription> + <use> + <flag name="cman">Enable <pkg>sys-cluster/cman</pkg> support.</flag> + <flag name="heartbeat">Enable <pkg>sys-cluster/heartbeat</pkg> support.</flag> + <flag name="smtp">Enable SMTP support via <pkg>net-libs/libesmtp</pkg></flag> + </use> + <upstream> + <remote-id type="github">ClusterLabs/pacemaker</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-cluster/pacemaker/pacemaker-1.1.12-r2.ebuild b/sys-cluster/pacemaker/pacemaker-1.1.12-r2.ebuild new file mode 100644 index 000000000000..fc65ae9855a1 --- /dev/null +++ b/sys-cluster/pacemaker/pacemaker-1.1.12-r2.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" +PYTHON_COMPAT=( python2_7 ) +WANT_AUTOMAKE="1.12" + +inherit autotools eutils python-single-r1 + +MY_PN="Pacemaker" +MY_P=${MY_PN}-${PV/_/-} + +DESCRIPTION="Pacemaker CRM" +HOMEPAGE="http://www.linux-ha.org/wiki/Pacemaker" +SRC_URI="https://github.com/ClusterLabs/${PN}/archive/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 hppa x86" +REQUIRED_USE="cman? ( !heartbeat )" +IUSE="acl cman heartbeat smtp snmp static-libs" + +DEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + sys-cluster/cluster-glue + >=sys-cluster/libqb-0.14.0 + sys-cluster/resource-agents + cman? ( sys-cluster/cman ) + heartbeat? ( >=sys-cluster/heartbeat-3.0.0 ) + !heartbeat? ( sys-cluster/corosync ) + smtp? ( net-libs/libesmtp ) + snmp? ( net-analyzer/net-snmp ) +" +RDEPEND="${DEPEND}" + +REQUIRED_USE=${PYTHON_REQUIRED_USE} + +PATCHES=( + "${FILESDIR}"/pacemaker-1.1.10-tinfo.patch + "${FILESDIR}"/pacemaker-1.1.12-glib.patch + "${FILESDIR}"/pacemaker-1.1.12-stonith.patch +) + +S="${WORKDIR}/${PN}-${MY_P}" + +src_prepare() { + epatch "${PATCHES[@]}" + epatch_user + + # bug #490908 + cp "${FILESDIR}/ping" extra/resources/ping || die + + sed -i -e "/ggdb3/d" configure.ac || die + sed -i -e "s/ -ggdb//g" configure.ac || die + sed -i -e "s/uid2username(uid)/uid2username(uid_client)/g" lib/common/ipc.c || die + sed -i -e "s:<glib/ghash.h>:<glib.h>:" lib/ais/plugin.c || die + eautoreconf + + python_fix_shebang . +} + +src_configure() { + local myopts="" + if use heartbeat ; then + myopts="--without-corosync" + else + myopts="--with-ais" + fi + # appends lib to localstatedir automatically + econf \ + --libdir=/usr/$(get_libdir) \ + --localstatedir=/var \ + --disable-dependency-tracking \ + --disable-fatal-warnings \ + $(use_with acl) \ + $(use_with cman cs-quorum) \ + $(use_with cman cman) \ + $(use_with heartbeat) \ + $(use_with smtp esmtp) \ + $(use_with snmp) \ + $(use_enable static-libs static) \ + ${myopts} +} + +src_install() { + default + rm -rf "${D}"/var/run "${D}"/etc/init.d + newinitd "${FILESDIR}/${PN}.initd" ${PN} || die + if has_version "<sys-cluster/corosync-2.0"; then + insinto /etc/corosync/service.d + newins "${FILESDIR}/${PN}.service" ${PN} || die + fi +} + +pkg_postinst() { + elog " " + elog "Looking for the crm CLI ? emerge sys-cluster/crmsh !" + elog " " +} diff --git a/sys-cluster/pacemaker/pacemaker-1.1.14.ebuild b/sys-cluster/pacemaker/pacemaker-1.1.14.ebuild new file mode 100644 index 000000000000..492f531c7022 --- /dev/null +++ b/sys-cluster/pacemaker/pacemaker-1.1.14.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 ) +WANT_AUTOMAKE="1.12" + +inherit autotools eutils python-single-r1 + +MY_PN="Pacemaker" +MY_P=${MY_PN}-${PV/_/-} + +DESCRIPTION="Pacemaker CRM" +HOMEPAGE="http://www.linux-ha.org/wiki/Pacemaker" +SRC_URI="https://github.com/ClusterLabs/${PN}/archive/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~x86" +REQUIRED_USE="cman? ( !heartbeat )" +IUSE="acl cman heartbeat smtp snmp static-libs" + +DEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + sys-cluster/cluster-glue + >=sys-cluster/libqb-0.14.0 + sys-cluster/resource-agents + cman? ( sys-cluster/cman ) + heartbeat? ( >=sys-cluster/heartbeat-3.0.0 ) + !heartbeat? ( sys-cluster/corosync ) + smtp? ( net-libs/libesmtp ) + snmp? ( net-analyzer/net-snmp ) +" +RDEPEND="${DEPEND}" + +REQUIRED_USE=${PYTHON_REQUIRED_USE} + +S="${WORKDIR}/${PN}-${MY_P}" + +src_prepare() { + default + epatch_user + + # bug #490908 + cp "${FILESDIR}/ping" extra/resources/ping || die + + sed -i -e "/ggdb3/d" configure.ac || die + sed -i -e "s/ -ggdb//g" configure.ac || die + sed -i -e "s/uid2username(uid)/uid2username(uid_client)/g" lib/common/ipc.c || die + sed -i -e "s:<glib/ghash.h>:<glib.h>:" lib/ais/plugin.c || die + eautoreconf + + python_fix_shebang . +} + +src_configure() { + local myopts="" + if use heartbeat ; then + myopts="--without-corosync" + else + myopts="--with-ais" + fi + # appends lib to localstatedir automatically + econf \ + --libdir=/usr/$(get_libdir) \ + --localstatedir=/var \ + --disable-dependency-tracking \ + --disable-fatal-warnings \ + $(use_with acl) \ + $(use_with cman cs-quorum) \ + $(use_with cman cman) \ + $(use_with heartbeat) \ + $(use_with smtp esmtp) \ + $(use_with snmp) \ + $(use_enable static-libs static) \ + ${myopts} +} + +src_install() { + default + rm -rf "${D}"/var/run "${D}"/etc/init.d + newinitd "${FILESDIR}/${PN}.initd" ${PN} || die + if has_version "<sys-cluster/corosync-2.0"; then + insinto /etc/corosync/service.d + newins "${FILESDIR}/${PN}.service" ${PN} || die + fi +} + +pkg_postinst() { + elog " " + elog "Looking for the crm CLI ? emerge sys-cluster/crmsh !" + elog " " +} diff --git a/sys-cluster/pacemaker/pacemaker-1.1.16.ebuild b/sys-cluster/pacemaker/pacemaker-1.1.16.ebuild new file mode 100644 index 000000000000..300cc72025e1 --- /dev/null +++ b/sys-cluster/pacemaker/pacemaker-1.1.16.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 ) + +inherit autotools eutils python-single-r1 + +MY_PN="Pacemaker" +MY_P=${MY_PN}-${PV/_/-} + +DESCRIPTION="Pacemaker CRM" +HOMEPAGE="http://www.linux-ha.org/wiki/Pacemaker" +SRC_URI="https://github.com/ClusterLabs/${PN}/archive/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~hppa x86" +REQUIRED_USE="cman? ( !heartbeat )" +IUSE="acl cman heartbeat smtp snmp static-libs" + +DEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + sys-cluster/cluster-glue + >=sys-cluster/libqb-0.14.0 + sys-cluster/resource-agents + cman? ( sys-cluster/cman ) + heartbeat? ( >=sys-cluster/heartbeat-3.0.0 ) + !heartbeat? ( sys-cluster/corosync ) + smtp? ( net-libs/libesmtp ) + snmp? ( net-analyzer/net-snmp ) +" +RDEPEND="${DEPEND}" + +REQUIRED_USE=${PYTHON_REQUIRED_USE} + +S="${WORKDIR}/${PN}-${MY_P}" + +src_prepare() { + default + sed -i -e "s/ -ggdb//g" configure.ac || die + eautoreconf + python_fix_shebang . +} + +src_configure() { + local myopts="" + if use heartbeat ; then + myopts="--without-corosync" + else + myopts="--with-ais" + fi + # appends lib to localstatedir automatically + econf \ + --libdir=/usr/$(get_libdir) \ + --localstatedir=/var \ + --disable-dependency-tracking \ + --disable-fatal-warnings \ + $(use_with acl) \ + $(use_with cman cs-quorum) \ + $(use_with cman cman) \ + $(use_with heartbeat) \ + $(use_with smtp esmtp) \ + $(use_with snmp) \ + $(use_enable static-libs static) \ + ${myopts} +} + +src_install() { + default + rm -rf "${D}"/var/run "${D}"/etc/init.d + newinitd "${FILESDIR}/${PN}.initd" ${PN} || die + if has_version "<sys-cluster/corosync-2.0"; then + insinto /etc/corosync/service.d + newins "${FILESDIR}/${PN}.service" ${PN} || die + fi +} |