summaryrefslogtreecommitdiff
path: root/sys-cluster/cman
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-cluster/cman
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-cluster/cman')
-rw-r--r--sys-cluster/cman/Manifest11
-rw-r--r--sys-cluster/cman/cman-3.1.5-r1.ebuild100
-rw-r--r--sys-cluster/cman/cman-3.1.5.ebuild100
-rw-r--r--sys-cluster/cman/cman-3.2.0.ebuild100
-rw-r--r--sys-cluster/cman/files/cman.confd67
-rw-r--r--sys-cluster/cman/files/cman.initd318
-rw-r--r--sys-cluster/cman/files/cman.initd-3.1.5-r1349
-rw-r--r--sys-cluster/cman/metadata.xml9
8 files changed, 1054 insertions, 0 deletions
diff --git a/sys-cluster/cman/Manifest b/sys-cluster/cman/Manifest
new file mode 100644
index 000000000000..d21d3a3808d4
--- /dev/null
+++ b/sys-cluster/cman/Manifest
@@ -0,0 +1,11 @@
+AUX cman.confd 2797 SHA256 45f89870420c0855ace5a27149db878bd592a2f48c35711b40d29f3b358a2bf5 SHA512 97cfe35230198091261ab3202c2c4eb2683f43ae311c07a6d34d9ae9c47c71c004ce615993ad25189ee536cbf2863fb721a57c520b439de2e70a7cd3d84ae3fe WHIRLPOOL cf34d8d3e7f2d6c1bfa367ab8f1c969e21e255febc9bbc7418be3662dd82264bd0fd64866db0885794c05bf2f1b52db7af97903ffbf79cb040422d85ca601ea3
+AUX cman.initd 7115 SHA256 0cbdf73ebf572aecaab3fb21937dd70b78bfd129b3a8d87bb8996acc4172e53c SHA512 b3b0f4c5902431b02bc75aef42f7f463d9e6aec9c4895384997df4ff9806fe0bd7f88e4260da6cbea84fa479010f893271acf3e34f84aef0256e8f78edb655f4 WHIRLPOOL 0b687ea652de68d63fdcc79afd54c2e09d4ccb310afc73a359a67e9eb9d8e481a5806010d6765cba395327dbf7ff4a0996d8120ba5f0db096546e8acf26f05bf
+AUX cman.initd-3.1.5-r1 7860 SHA256 0143af03c92b1b6ad3ce937bbb1e0db1f763070ad40a7153edfbc302cc85c689 SHA512 9dbc73c7753ffdb5119160cbe544f74f14de77cd71cbe76975603ff3be7c601e6fd8084a7ae0acf44096b5b10448ba563453e7871aa035e7e706437b5088d717 WHIRLPOOL e1156a94fad30029ee424d970ac0837f7fcf974d49d3b6206373fb97160d2cab75d297539e63b575dd0b25b73458500a65039ec5af3aa13f44e946a7b8de4a2f
+DIST cluster-3.1.5.tar.gz 651449 SHA256 95be1b484f9c58af3c47a9d46dc2802d37f1b2b9028053f243a2c8bd1f07623e SHA512 692888ed55c6bb7ebf3b3e792ec071b5fcff4c35c181c5b0c9296e8222c62e10f8a6344af391fbae8186b39cb31e674632bde77ebcc1fcab758657ae4264634a WHIRLPOOL 9d511effd14f9644dea11d1aba22878846beaa6bad4686358ad552c918c2cb72bc5a59605ad2dd576f626ea95f48c9d6b0b8c79f75eb4a721f65b8a60d0728cf
+DIST cluster-3.2.0.tar.gz 688411 SHA256 96651381645cde0e32b06f83e180b1664232a5c589c72f06206e0539e0036cfb SHA512 00620b89564c4f9b67b679695749cd7515f49af43ace6a565e32e020ee66db219f3db3f53420d6460ea8c1cab03258305735fe5db81aab3953777015119533e9 WHIRLPOOL cc468ac8e879dadc157d585b22615d6ffcf0b38a5c93196f8aa9564467e8b8aae6c2688faa9d9e8a98e68a605b86d84b6a79edb474d0cde231e5a78729ebb4e4
+EBUILD cman-3.1.5-r1.ebuild 2593 SHA256 62792d28c570c0f2dfeb8e96e2e068ddb326695ce9805def1b0b404dbe6028df SHA512 214a919410d3c0c533ce0da251d9290ba7a4f98788c63b392d7494ff64b16636a5db7d5b27896c9de2d018ebe730e265b009d5fcd12e00ad404af44c102afea4 WHIRLPOOL 66bcd5eef365321ec3b10a755ac6414f6594622958581c1101d3ddfd5b5f6b2c1630622c1c36994578f424e235d0496c9b3a4235f2d6ea2b8487398746a1d0e7
+EBUILD cman-3.1.5.ebuild 2584 SHA256 61a2b005c2585a945b506fcfed65f2ad4aad3156e8cd5fcb259c62a317bc3922 SHA512 0215864ff1847aa753fb44e4d2c275223d9775202a52d101b5c8f5579a330390508a4d08fc83e70360a5e02169e921a1de8e7076b933ba1b202a361abf005b87 WHIRLPOOL 8d62c48c2780dd1722b7bd3bd62c36027662d3e385df89b124ed355fec9eb340ba89f7741a703e4c0e8896884fbd53001e4febecbed264c950aff21f3a34e106
+EBUILD cman-3.2.0.ebuild 2593 SHA256 a95e6f5582d4e41f909c21d51ae0f0da1d983791ae86c6c8fe26feb78437772c SHA512 391c839a011888c5a2a4d7d82f8018a421762030422e894b8836f44a1170a64ba06672b23d08d062f42adc5e79bc1bd62ab455d4d04ff2ce203dae32f41edcbd WHIRLPOOL 4cea2665d4f935446b3efc1761374208a32b1f8be5aeea57c5d663467670d8b1d974b75661365296f83a9f3175751d425631b10e2b57b1641fdf8081dcf045b7
+MISC ChangeLog 2786 SHA256 549b1bd99c302e51e71bc0e4fd569595a47890d2d234e57df40a721061fb93ca SHA512 e9f64d0d5eea9296d2e575aeb7bf22bde02d2115b8fc221f673bc3f305689bae3e11bb767c3861f57a4a0e72d6ab7fb01dfe965b39cafd6ece4313d771de389c WHIRLPOOL 290f225eace070863f5f8c59bfe35dbf37e8548d9c5857658342743730a7c74c0eed2f395702d09c46002ce439900213128a29486a2f5925d92b76d0609b4864
+MISC ChangeLog-2015 1066 SHA256 f25e9da2b7123f6e89bb5cb13d9c0e43cb8bb6cc5bc4735bf639b5886b3a644e SHA512 9ab79b8c678e15c6b4ebc060b5288f25f21b50439e23fbf98fc75165986a5c01e0ae7f6d1ae0413982f2e9ec27090e601a459d078c0bb2ccca794fe853b4df75 WHIRLPOOL 32fef4593379214ab4f82af4777c42226eabf03800abac57c67273e02d724b0891003bfad67589c65fc91c24b856f600a7055fc6ae20b386e07ca8d2ba118bb2
+MISC metadata.xml 309 SHA256 2a3659fbfa9f104093f400f6673c1b3a2adb0bb679d233e1619809a1d56c3f02 SHA512 63af840873be4c3b0656822e4d1d36a1b30cea6d1f295cf0084e3a9fdf2f589bb6923dfed365ad6399842a0d8388607f9988000843c35549900db94acd9f9863 WHIRLPOOL 256e9072ee7e5a9644e3733a5167013f33789d40c4975a923ce451fa122871d41676c95464579143292b3aadd185f9e23535d60e375a0434568e1768535b2ccd
diff --git a/sys-cluster/cman/cman-3.1.5-r1.ebuild b/sys-cluster/cman/cman-3.1.5-r1.ebuild
new file mode 100644
index 000000000000..ebddee75dd57
--- /dev/null
+++ b/sys-cluster/cman/cman-3.1.5-r1.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit linux-info multilib toolchain-funcs versionator
+
+CLUSTER_RELEASE="${PV}"
+MY_P="cluster-${CLUSTER_RELEASE}"
+
+MAJ_PV="$(get_major_version)"
+MIN_PV="$(get_version_component_range 2-3)"
+
+DESCRIPTION="Cluster Manager"
+HOMEPAGE="https://fedorahosted.org/cluster/wiki/HomePage"
+SRC_URI="https://fedorahosted.org/releases/c/l/cluster/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+IUSE="dbus ldap"
+
+RDEPEND="dev-libs/libxml2
+ dev-libs/libxslt
+ dbus? ( sys-apps/dbus )
+ ldap? ( net-nds/openldap )
+ sys-cluster/corosync
+ sys-cluster/openais
+ ~sys-cluster/libccs-${PV}
+ ~sys-cluster/libfence-${PV}
+ ~sys-cluster/libcman-${PV}
+ ~sys-cluster/libdlm-${PV}
+ ~sys-cluster/liblogthread-${PV}
+ !sys-cluster/dlm
+"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.24"
+
+S="${WORKDIR}/${MY_P}"
+
+# TODO:
+# * Gentoo'ise the init script
+
+src_configure() {
+ # cluster libs have their own separate packages
+ sed -i -e 's|lib||' "${S}/cman/Makefile" || die
+ sed -i -e 's|liblogthread||' "${S}/common/Makefile" || die
+ sed -i -e 's|libs||' "${S}/config/Makefile" || die
+ sed -i -e 's|libdlm libdlmcontrol||' "${S}/dlm/Makefile" || die
+ sed -i -e 's|libfence libfenced||' "${S}/fence/Makefile" || die
+ sed -i -e 's|fence/libfenced||' "${S}/Makefile" || die
+
+ sed -i \
+ -e 's|\(^all:.*\)depends |\1|' \
+ config/tools/ccs_tool/Makefile \
+ fence/fence{d,_node,_tool}/Makefile \
+ cman/{cman_tool,daemon,tests,qdisk,notifyd}/Makefile \
+ dlm/{tool,tests/usertest}/Makefile \
+ || die "sed failed"
+
+ if ! use ldap ; then
+ sed -i -e 's|ldap||' config/plugins/Makefile || die "sed failed"
+ fi
+ local myopts=""
+ use dbus || myopts="--disable_dbus"
+ ./configure \
+ --cc=$(tc-getCC) \
+ --cflags="-Wall" \
+ --libdir=/usr/$(get_libdir) \
+ --disable_kernel_check \
+ --kernel_src=${KERNEL_DIR} \
+ --somajor="$MAJ_PV" \
+ --sominor="$MIN_PV" \
+ --without_rgmanager \
+ --without_bindings \
+ ${myopts} \
+ || die "configure problem"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # we have to create it in the init.d script anyway
+ rmdir "${D}"/var/run/{cluster,}
+
+ keepdir /var/{lib,log}/cluster
+ keepdir /etc/cluster/cman-notify.d
+
+ rm -rf "${D}/usr/share/doc"
+ dodoc \
+ doc/{usage.txt,cman_notify_template.sh} \
+ config/plugins/ldap/*.ldif
+ dohtml doc/*.html
+
+ # lib-specific man pages are provided by the corresponding packages
+ rm "${D}/usr/share/man/man3/libdlm.3"
+
+ newinitd "${FILESDIR}/${PN}.initd-3.1.5-r1" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+}
diff --git a/sys-cluster/cman/cman-3.1.5.ebuild b/sys-cluster/cman/cman-3.1.5.ebuild
new file mode 100644
index 000000000000..f97954b26b3c
--- /dev/null
+++ b/sys-cluster/cman/cman-3.1.5.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit linux-info multilib toolchain-funcs versionator
+
+CLUSTER_RELEASE="${PV}"
+MY_P="cluster-${CLUSTER_RELEASE}"
+
+MAJ_PV="$(get_major_version)"
+MIN_PV="$(get_version_component_range 2-3)"
+
+DESCRIPTION="Cluster Manager"
+HOMEPAGE="https://fedorahosted.org/cluster/wiki/HomePage"
+SRC_URI="https://fedorahosted.org/releases/c/l/cluster/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+IUSE="dbus ldap"
+
+RDEPEND="dev-libs/libxml2
+ dev-libs/libxslt
+ dbus? ( sys-apps/dbus )
+ ldap? ( net-nds/openldap )
+ sys-cluster/corosync
+ sys-cluster/openais
+ ~sys-cluster/libccs-${PV}
+ ~sys-cluster/libfence-${PV}
+ ~sys-cluster/libcman-${PV}
+ ~sys-cluster/libdlm-${PV}
+ ~sys-cluster/liblogthread-${PV}
+ !sys-cluster/dlm
+"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.24"
+
+S="${WORKDIR}/${MY_P}"
+
+# TODO:
+# * Gentoo'ise the init script
+
+src_configure() {
+ # cluster libs have their own separate packages
+ sed -i -e 's|lib||' "${S}/cman/Makefile" || die
+ sed -i -e 's|liblogthread||' "${S}/common/Makefile" || die
+ sed -i -e 's|libs||' "${S}/config/Makefile" || die
+ sed -i -e 's|libdlm libdlmcontrol||' "${S}/dlm/Makefile" || die
+ sed -i -e 's|libfence libfenced||' "${S}/fence/Makefile" || die
+ sed -i -e 's|fence/libfenced||' "${S}/Makefile" || die
+
+ sed -i \
+ -e 's|\(^all:.*\)depends |\1|' \
+ config/tools/ccs_tool/Makefile \
+ fence/fence{d,_node,_tool}/Makefile \
+ cman/{cman_tool,daemon,tests,qdisk,notifyd}/Makefile \
+ dlm/{tool,tests/usertest}/Makefile \
+ || die "sed failed"
+
+ if ! use ldap ; then
+ sed -i -e 's|ldap||' config/plugins/Makefile || die "sed failed"
+ fi
+ local myopts=""
+ use dbus || myopts="--disable_dbus"
+ ./configure \
+ --cc=$(tc-getCC) \
+ --cflags="-Wall" \
+ --libdir=/usr/$(get_libdir) \
+ --disable_kernel_check \
+ --kernel_src=${KERNEL_DIR} \
+ --somajor="$MAJ_PV" \
+ --sominor="$MIN_PV" \
+ --without_rgmanager \
+ --without_bindings \
+ ${myopts} \
+ || die "configure problem"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # we have to create it in the init.d script anyway
+ rmdir "${D}"/var/run/{cluster,}
+
+ keepdir /var/{lib,log}/cluster
+ keepdir /etc/cluster/cman-notify.d
+
+ rm -rf "${D}/usr/share/doc"
+ dodoc \
+ doc/{usage.txt,cman_notify_template.sh} \
+ config/plugins/ldap/*.ldif
+ dohtml doc/*.html
+
+ # lib-specific man pages are provided by the corresponding packages
+ rm "${D}/usr/share/man/man3/libdlm.3"
+
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+}
diff --git a/sys-cluster/cman/cman-3.2.0.ebuild b/sys-cluster/cman/cman-3.2.0.ebuild
new file mode 100644
index 000000000000..2b59cd78f283
--- /dev/null
+++ b/sys-cluster/cman/cman-3.2.0.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit linux-info multilib toolchain-funcs versionator
+
+CLUSTER_RELEASE="${PV}"
+MY_P="cluster-${CLUSTER_RELEASE}"
+
+MAJ_PV="$(get_major_version)"
+MIN_PV="$(get_version_component_range 2-3)"
+
+DESCRIPTION="Cluster Manager"
+HOMEPAGE="https://fedorahosted.org/cluster/wiki/HomePage"
+SRC_URI="https://fedorahosted.org/releases/c/l/cluster/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+IUSE="dbus ldap"
+
+RDEPEND="dev-libs/libxml2
+ dev-libs/libxslt
+ dbus? ( sys-apps/dbus )
+ ldap? ( net-nds/openldap )
+ sys-cluster/corosync
+ sys-cluster/openais
+ ~sys-cluster/libccs-${PV}
+ ~sys-cluster/libfence-${PV}
+ ~sys-cluster/libcman-${PV}
+ ~sys-cluster/libdlm-${PV}
+ ~sys-cluster/liblogthread-${PV}
+ !sys-cluster/dlm
+"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.24"
+
+S="${WORKDIR}/${MY_P}"
+
+# TODO:
+# * Gentoo'ise the init script
+
+src_configure() {
+ # cluster libs have their own separate packages
+ sed -i -e 's|lib||' "${S}/cman/Makefile" || die
+ sed -i -e 's|liblogthread||' "${S}/common/Makefile" || die
+ sed -i -e 's|libs||' "${S}/config/Makefile" || die
+ sed -i -e 's|libdlm libdlmcontrol||' "${S}/dlm/Makefile" || die
+ sed -i -e 's|libfence libfenced||' "${S}/fence/Makefile" || die
+ sed -i -e 's|fence/libfenced||' "${S}/Makefile" || die
+
+ sed -i \
+ -e 's|\(^all:.*\)depends |\1|' \
+ config/tools/ccs_tool/Makefile \
+ fence/fence{d,_node,_tool}/Makefile \
+ cman/{cman_tool,daemon,tests,qdisk,notifyd}/Makefile \
+ dlm/{tool,tests/usertest}/Makefile \
+ || die "sed failed"
+
+ if ! use ldap ; then
+ sed -i -e 's|ldap||' config/plugins/Makefile || die "sed failed"
+ fi
+ local myopts=""
+ use dbus || myopts="--disable_dbus"
+ ./configure \
+ --cc=$(tc-getCC) \
+ --cflags="-Wall" \
+ --libdir=/usr/$(get_libdir) \
+ --disable_kernel_check \
+ --kernel_src=${KERNEL_DIR} \
+ --somajor="$MAJ_PV" \
+ --sominor="$MIN_PV" \
+ --without_rgmanager \
+ --without_bindings \
+ ${myopts} \
+ || die "configure problem"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # we have to create it in the init.d script anyway
+ rmdir "${D}"/var/run/{cluster,}
+
+ keepdir /var/{lib,log}/cluster
+ keepdir /etc/cluster/cman-notify.d
+
+ rm -rf "${D}/usr/share/doc"
+ dodoc \
+ doc/{usage.txt,cman_notify_template.sh} \
+ config/plugins/ldap/*.ldif
+ dohtml doc/*.html
+
+ # lib-specific man pages are provided by the corresponding packages
+ rm "${D}/usr/share/man/man3/libdlm.3"
+
+ newinitd "${FILESDIR}/${PN}.initd-3.1.5-r1" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+}
diff --git a/sys-cluster/cman/files/cman.confd b/sys-cluster/cman/files/cman.confd
new file mode 100644
index 000000000000..14b7ea791614
--- /dev/null
+++ b/sys-cluster/cman/files/cman.confd
@@ -0,0 +1,67 @@
+CCSD_OPTS=
+
+# CMAN_CLUSTER_TIMEOUT -- amount of time to wait for joinging a cluster
+# before giving up. If CMAN_CLUSTER_TIMEOUT is positive, then we will
+# wait CMAN_CLUSTER_TIMEOUT seconds before giving up and failing when
+# a cluster is not joined. If CMAN_CLUSTER_TIMEOUT is zero, then
+# wait indefinately for a cluster join. If CMAN_CLUSTER_TIMEOUT is
+# negative, do not check to see that the cluster has been joined
+CMAN_CLUSTER_TIMEOUT=120
+
+# CMAN_QUORUM_TIMEOUT -- amount of time to wait for a quorate cluster on
+# startup quorum is needed by many other applications, so we may as
+# well wait here. If CMAN_QUORUM_TIMEOUT is less than 1, quorum will
+# be ignored.
+CMAN_QUORUM_TIMEOUT=300
+
+# CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a
+# cluster member before calling cman_tool leave during shutdown.
+# default is 60 seconds
+CMAN_SHUTDOWN_TIMEOUT=60
+
+# CMAN_JOIN_OPTIONS
+#CMAN_JOIN_OPTS="-c ...."
+
+# CMAN_LEAVE_OPTIONS
+#CMAN_LEAVE_OPTS=""
+
+
+# ex: FENCED_OPTS="-w -t 300"
+FENCED_OPTS=""
+
+
+# TODO ?
+# CMAN_NOTIFYD_START - control the startup behaviour for cmannotifyd
+# the variable can take 3 values:
+# yes | will always start cmannotifyd
+# no | will never start cmannotifyd
+# conditional (default) | will start cmannotifyd only if scriptlets
+# are found in @NOTIFYDDIR@
+[ -z "$CMAN_NOTIFYD_START" ] && CMAN_NOTIFYD_START=conditional
+
+# CMAN_SSHD_START - control sshd startup behaviour
+# the variable can take 2 values:
+# yes | cman will start sshd as early as possible
+# no (default) | cman will not start sshd
+[ -z "$CMAN_SSHD_START" ] && CMAN_SSHD_START=no
+
+# FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
+# complete. If the join hasn't completed in this time, fence_tool join
+# exits with an error, and this script exits with an error. To wait
+# indefinitely set the value to -1.
+[ -z "$FENCE_JOIN_TIMEOUT" ] && FENCE_JOIN_TIMEOUT=20
+
+# FENCED_MEMBER_DELAY -- amount of time to delay fence_tool join to allow
+# all nodes in cluster.conf to become cluster members. In seconds.
+[ -z "$FENCED_MEMBER_DELAY" ] && FENCED_MEMBER_DELAY=45
+
+# FENCE_JOIN -- boolean value used to control whether or not this node
+# should join the fence domain. If FENCE_JOIN is set to "no", then
+# the script will not attempt to the fence domain. If FENCE_JOIN is
+# set to "yes", then the script will attempt to join the fence domain.
+# If FENCE_JOIN is set to any other value, the default behavior is
+# to join the fence domain (equivalent to "yes").
+[ -z "$FENCE_JOIN" ] && FENCE_JOIN="yes"
+
+# FENCED_OPTS -- allow extra options to be passed to fence daemon.
+[ -z "$FENCED_OPTS" ] && FENCED_OPTS="" \ No newline at end of file
diff --git a/sys-cluster/cman/files/cman.initd b/sys-cluster/cman/files/cman.initd
new file mode 100644
index 000000000000..68c34c146818
--- /dev/null
+++ b/sys-cluster/cman/files/cman.initd
@@ -0,0 +1,318 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CMAN_TOOL="/usr/sbin/cman_tool"
+FENCE_TOOL="/usr/sbin/fence_tool"
+GFS_CONTROLD="/usr/sbin/gfs_controld"
+DLM_CONTROLD="/usr/sbin/dlm_controld"
+GROUPD="/usr/sbin/groupd"
+FENCED="/usr/sbin/fenced"
+CCSD="/usr/sbin/ccsd"
+
+[ -z "$CCSD_OPTS" ] && CCSD_OPTS=""
+[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=120
+[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0
+[ -z "$CMAN_SHUTDOWN_TIMEOUT" ] && CMAN_SHUTDOWN_TIMEOUT=60
+[ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300
+[ -z "$FENCED_MEMBER_DELAY" ] && FENCED_MEMBER_DELAY=300
+
+depend() {
+ use net
+ after xend
+ after xendomains
+ provide cman
+}
+
+load_modules() {
+ local module modules
+ modules=$1
+
+ for module in ${modules}; do
+ ebegin "Loading ${module} kernel module"
+ modprobe ${module} > /dev/null
+ eend $? "Failed to load ${module} kernel module"
+ done
+}
+
+unload_modules() {
+ local module modules
+ modules=$1
+
+ for module in ${modules}; do
+ ebegin "Unloading ${module} kernel module"
+ modprobe -r ${module} > /dev/null
+ eend $? "Failed to unload ${module} kernel module"
+ done
+}
+
+check_configfs() {
+ awk '{ print $2 }' /etc/mtab | grep "/sys/kernel/config" &> /dev/null\
+ && awk '{ print $3 }' /etc/mtab | grep "configfs" &> /dev/null
+
+ if [ $? -ne 0 ]; then
+ ewarn "Please add the following line to /etc/fstab:"
+ ewarn "none configfs /sys/kernel/config defaults 0 0"
+ eend 1 "configfs not mounted at /sys/kernel/config"
+ fi
+}
+
+mount_configfs()
+{
+ local module=$(awk '$2 == "configfs" { print $2 }' /proc/filesystems)
+
+ if [ -z "${module}" ]; then
+ load_modules "configfs"
+ sleep 1s
+ fi
+
+ # configfs
+ awk '{ print $2 }' /etc/mtab | grep "/sys/kernel/config" &> /dev/null \
+ && awk '{ print $3 }' /etc/mtab | grep "configfs" &> /dev/null
+
+ if [ $? -ne 0 ]
+ then
+ ebegin "Mounting ConfigFS"
+ /bin/mount -t configfs none /sys/kernel/config 2>&1
+ eend $?
+ fi
+ return 0
+}
+
+umount_configfs() {
+ local sig retry
+ local entry entries
+
+ entries="$(awk '$3 == "configfs" { print $2 }' /proc/mounts | sort -r)"
+
+ for entry in $entries; do
+ ebegin "Unmounting ConfigFS"
+ umount $entry &>/dev/null
+ eend $?
+ done
+
+ local module=$(awk '$1 == "configfs" { print $1 }' /proc/modules)
+
+ if [ ! -z "${module}" ]; then
+ unload_modules "configfs"
+ sleep 1s
+ fi
+}
+
+umount_gfs_filesystems() {
+ local sig retry
+ local remaining="$(awk '$3 == "gfs" || $3 == "gfs2" { print $2 }' /proc/mounts | sort -r)"
+
+ if [ -n "${remaining}" ]
+ then
+ sig=
+ retry=3
+ while [ -n "${remaining}" -a "${retry}" -gt 0 ]
+ do
+ if [ "${retry}" -lt 3 ]
+ then
+ ebegin "Unmounting GFS filesystems (retry)"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems this retry"
+ else
+ ebegin "Unmounting GFS filesystems"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems"
+ fi
+ remaining="$(awk '$3 == "gfs" || $3 == "gfs2" { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+ [ -z "${remaining}" ] && break
+ /bin/fuser -k -m ${sig} ${remaining} &>/dev/null
+ sleep 5
+ retry=$((${retry} -1))
+ sig=-9
+ done
+ fi
+}
+
+unload_allmodules() {
+ local modules
+
+ modules=$(awk '$1 == "lock_gulm" || \
+ $1 == "lock_dlm" || $1 == "dlm" || \
+ $1 == "lock_harness" || $1 == "gfs2" || \
+ $1 == "gfs" { print $1 }' /proc/modules)
+
+ #modules=$(awk '$1 == "lock_harness" || \
+ # $1 == "gfs" { print $1 }' /proc/modules)
+
+ unload_modules "${modules}"
+}
+
+start_ccsd() {
+ ebegin "Starting ccsd"
+ start-stop-daemon --start --quiet --exec ${CCSD} -- ${CCSD_OPTS}
+ eend $?
+}
+
+stop_ccsd() {
+ ebegin "Stopping ccsd"
+ start-stop-daemon --stop --quiet -s 9 --exec ${CCSD}
+ eend $?
+}
+
+start_cman() {
+ ${CMAN_TOOL} status &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ ebegin "Starting cman"
+ ${CMAN_TOOL} -t ${CMAN_CLUSTER_TIMEOUT} \
+ -w join ${CMAN_JOIN_OPTS} &> /dev/null
+
+ if [ "$?" -ne 0 ]
+ then
+ eend 1 "Failed to start cman"
+ else
+ eend 0
+
+ # make sure that we are quorate?
+ if [ ${CMAN_QUORUM_TIMEOUT} -gt 0 ]
+ then
+ ebegin "Waiting for quorum (${CMAN_QUORUM_TIMEOUT} secs)"
+ ${CMAN_TOOL} -t ${CMAN_QUORUM_TIMEOUT} -q wait
+ eend $?
+ fi
+ fi
+ else
+ einfo "cman already running"
+ fi
+}
+
+stop_cman() {
+ ebegin "Stopping cman"
+ local stat=0
+ ${CMAN_TOOL} status > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ retry=3
+ stat=1
+ while [ "${stat}" -eq 1 -a "${retry}" -gt 0 ]
+ do
+ #sleep 2
+ #${CMAN_TOOL} -w -t ${CMAN_SHUTDOWN_TIMEOUT} \
+ # leave remove ${CMAN_LEAVE_OPTS} > /dev/null
+ ${CMAN_TOOL} leave -t ${CMAN_SHUTDOWN_TIMEOUT} ${CMAN_LEAVE_OPTS} \
+ remove &> /dev/null
+ stat=$?
+ retry=$((${retry} -1))
+ done
+ fi
+ eend ${stat}
+}
+
+start_groupd() {
+ ebegin "Starting groupd"
+ start-stop-daemon --start --exec ${GROUPD} --name groupd
+ eend $?
+}
+
+stop_groupd() {
+ ebegin "Stopping groupd"
+ start-stop-daemon --stop --exec ${GROUPD} --name groupd
+ eend $?
+}
+
+start_fenced() {
+ ebegin "Starting fenced"
+ start-stop-daemon --start --exec ${FENCED} --name fenced
+ eend $?
+
+ ${CMAN_TOOL} status | grep Flags | grep 2node &> /dev/null
+ local errmsg=$?
+
+ ebegin "Joining fence domain"
+ if [ "${errmsg}" -ne 0 ]
+ then
+ ${FENCE_TOOL} join -t $FENCED_START_TIMEOUT &> /dev/null
+ [ $? -eq 0 ] && errmsg=$? || errmsg=1
+ else
+ ${FENCE_TOOL} join -m $FENCED_MEMBER_DELAY &> /dev/null
+ [ $? -eq 0 ] && errmsg=$? || errmsg=1
+ fi
+ eend $errmsg
+}
+
+stop_fenced() {
+ # fenced services
+# local fence_status="$( ${CMAN_TOOL} services | awk '$1 ~ /fence/ { print $3 }')"
+# if [ -n "${fence_status}" ]; then
+# if [ -x ${FENCE_TOOL} ]; then
+# ebegin "Leaving fence domain"
+# ${FENCE_TOOL} leave > /dev/null 2>&1
+# eend $?
+# fi
+# fi
+
+ if [ -x ${FENCE_TOOL} ]; then
+ if ${FENCE_TOOL} ls >/dev/null 2>&1; then
+ ebegin "Leaving fence domain"
+ ${FENCE_TOOL} leave > /dev/null 2>&1
+ eend $?
+ fi
+ fi
+
+ ebegin "Stopping fenced"
+ start-stop-daemon --stop --exec ${FENCED} --name fenced
+ eend $?
+}
+
+start_gfs_controld() {
+ ebegin "Starting gfs_controld"
+ start-stop-daemon --start --exec ${GFS_CONTROLD} --name gfs_controld
+ eend $?
+}
+
+stop_gfs_controld() {
+ ebegin "Stopping gfs_controld"
+ start-stop-daemon --stop --exec ${GFS_CONTROLD} --name gfs_controld
+ eend $?
+}
+
+start_dlm_controld() {
+ ebegin "Starting dlm_controld"
+ start-stop-daemon --start --exec ${DLM_CONTROLD} --name dlm_controld
+ eend $?
+}
+
+stop_dlm_controld() {
+ ebegin "Stopping dlm_controld"
+ start-stop-daemon --stop --exec ${DLM_CONTROLD} --name dlm_controld
+ eend $?
+}
+
+start() {
+ load_modules "dlm"
+
+ mkdir -p /var/run/cluster
+
+ mount_configfs
+# start_ccsd
+ start_cman
+ start_fenced
+ start_groupd
+ start_dlm_controld
+# start_gfs_controld
+}
+
+stop() {
+
+# umount GFS filesystems
+# umount_gfs_filesystems
+
+ stop_dlm_controld
+ stop_groupd
+ stop_fenced
+ stop_cman
+
+ #stop_gfs_controld
+ #stop_dlm_controld
+ #stop_groupd
+
+ unload_modules "dlm"
+# stop_ccsd
+# unload_allmodules
+ umount_configfs
+}
diff --git a/sys-cluster/cman/files/cman.initd-3.1.5-r1 b/sys-cluster/cman/files/cman.initd-3.1.5-r1
new file mode 100644
index 000000000000..04cf5f2e7f9e
--- /dev/null
+++ b/sys-cluster/cman/files/cman.initd-3.1.5-r1
@@ -0,0 +1,349 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CMAN_TOOL="/usr/sbin/cman_tool"
+FENCE_TOOL="/usr/sbin/fence_tool"
+GFS_CONTROLD="/usr/sbin/gfs_controld"
+DLM_CONTROLD="/usr/sbin/dlm_controld"
+GROUPD="/usr/sbin/groupd"
+FENCED="/usr/sbin/fenced"
+CCSD="/usr/sbin/ccsd"
+
+[ -z "$CCSD_OPTS" ] && CCSD_OPTS=""
+[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=120
+[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0
+[ -z "$CMAN_SHUTDOWN_TIMEOUT" ] && CMAN_SHUTDOWN_TIMEOUT=60
+[ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300
+[ -z "$FENCED_MEMBER_DELAY" ] && FENCED_MEMBER_DELAY=300
+
+depend() {
+ use net
+ after xend
+ after xendomains
+ provide cman
+}
+
+load_modules() {
+ local module modules
+ modules=$1
+
+ rcS=0 # catch the first error here
+ [ -f /proc/modules ] && for module in ${modules}; do
+ ebegin "Loading ${module} kernel module"
+ modprobe -q ${module}
+ rc=$? # error for this modprobe call
+ eend $rc "Failed to load ${module} kernel module"
+ [ $rc -ne 0 ] && rcS=$rc
+ done
+ return $rcS
+}
+
+unload_modules() {
+ local module modules
+ modules=$1
+
+ [ -f /proc/modules ] && for module in ${modules}; do
+ ebegin "Unloading ${module} kernel module"
+ modprobe -r ${module} > /dev/null
+ eend $? "Failed to unload ${module} kernel module"
+ done
+}
+
+check_configfs() {
+ awk '{ print $2 }' /proc/mounts | grep -sq "/sys/kernel/config" \
+ && awk '{ print $3 }' /proc/mounts | grep -sq "configfs"
+
+ if [ $? -ne 0 ]; then
+ ewarn "Please add the following line to /etc/fstab:"
+ ewarn "none configfs /sys/kernel/config defaults 0 0"
+ eend 1 "configfs not mounted at /sys/kernel/config"
+ fi
+}
+
+mount_configfs()
+{
+ local module=$(awk '$2 == "configfs" { print $2 }' /proc/filesystems)
+
+ if [ -z "${module}" ]; then
+ load_modules "configfs"
+ rc=$?
+ sleep 1s
+ [ $rc -ne 0 ] && return 1
+ fi
+
+ # configfs
+ awk '{ print $2 }' /proc/mounts | grep -sq "/sys/kernel/config" \
+ && awk '{ print $3 }' /proc/mounts | grep -sq "configfs"
+ rc=$?
+
+ if [ $rc -ne 0 ]
+ then
+ ebegin "Mounting ConfigFS"
+ /bin/mount -t configfs none /sys/kernel/config 2>&1
+ rc=$?
+ eend $rc
+ fi
+
+ return $rc
+}
+
+umount_configfs() {
+ local sig retry
+ local entry entries
+
+ entries="$(awk '$3 == "configfs" { print $2 }' /proc/mounts | sort -r)"
+
+ for entry in $entries; do
+ ebegin "Unmounting ConfigFS"
+ umount $entry >/dev/null 2>&1
+ eend $?
+ done
+
+ local module=$(awk '$1 == "configfs" { print $1 }' /proc/modules)
+
+ if [ ! -z "${module}" ]; then
+ unload_modules "configfs"
+ sleep 1s
+ fi
+}
+
+umount_gfs_filesystems() {
+ local sig retry
+ local remaining="$(awk '$3 == "gfs" || $3 == "gfs2" { print $2 }' /proc/mounts | sort -r)"
+
+ if [ -n "${remaining}" ]
+ then
+ sig=
+ retry=3
+ while [ -n "${remaining}" -a "${retry}" -gt 0 ]
+ do
+ if [ "${retry}" -lt 3 ]
+ then
+ ebegin "Unmounting GFS filesystems (retry)"
+ umount ${remaining} >/dev/null 2>&1
+ eend $? "Failed to unmount GFS filesystems this retry"
+ else
+ ebegin "Unmounting GFS filesystems"
+ umount ${remaining} >/dev/null 2>&1
+ eend $? "Failed to unmount GFS filesystems"
+ fi
+ remaining="$(awk '$3 == "gfs" || $3 == "gfs2" { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+ [ -z "${remaining}" ] && break
+ /bin/fuser -k -m ${sig} ${remaining} >/dev/null 2>&1
+ sleep 5
+ retry=$((${retry} -1))
+ sig=-9
+ done
+ fi
+}
+
+unload_allmodules() {
+ local modules
+
+ modules=$(awk '$1 == "lock_gulm" || \
+ $1 == "lock_dlm" || $1 == "dlm" || \
+ $1 == "lock_harness" || $1 == "gfs2" || \
+ $1 == "gfs" { print $1 }' /proc/modules)
+
+ #modules=$(awk '$1 == "lock_harness" || \
+ # $1 == "gfs" { print $1 }' /proc/modules)
+
+ unload_modules "${modules}"
+}
+
+start_ccsd() {
+ ebegin "Starting ccsd"
+ start-stop-daemon --start --quiet --exec ${CCSD} -- ${CCSD_OPTS}
+ eend $?
+}
+
+stop_ccsd() {
+ ebegin "Stopping ccsd"
+ start-stop-daemon --stop --quiet -s 9 --exec ${CCSD}
+ eend $?
+}
+
+start_cman() {
+ ${CMAN_TOOL} status >/dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ ebegin "Starting cman"
+ ${CMAN_TOOL} -t ${CMAN_CLUSTER_TIMEOUT} \
+ -w join ${CMAN_JOIN_OPTS} >/dev/null 2>&1
+
+ if [ "$?" -ne 0 ]
+ then
+ eend 1 "Failed to start cman"
+ return 1
+ else
+ eend 0
+
+ # make sure that we are quorate?
+ if [ ${CMAN_QUORUM_TIMEOUT} -gt 0 ]
+ then
+ ebegin "Waiting for quorum (${CMAN_QUORUM_TIMEOUT} secs)"
+ ${CMAN_TOOL} -t ${CMAN_QUORUM_TIMEOUT} -q wait
+ rc=$?
+ eend $rc
+ return $rc
+ fi
+ fi
+ else
+ einfo "cman already running"
+ fi
+}
+
+stop_cman() {
+ ebegin "Stopping cman"
+ local stat=0
+ ${CMAN_TOOL} status > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ retry=3
+ stat=1
+ while [ "${stat}" -eq 1 -a "${retry}" -gt 0 ]
+ do
+ #sleep 2
+ #${CMAN_TOOL} -w -t ${CMAN_SHUTDOWN_TIMEOUT} \
+ # leave remove ${CMAN_LEAVE_OPTS} > /dev/null
+ ${CMAN_TOOL} leave -t ${CMAN_SHUTDOWN_TIMEOUT} ${CMAN_LEAVE_OPTS} \
+ remove >/dev/null 2>&1
+ stat=$?
+ retry=$((${retry} -1))
+ done
+ fi
+ eend ${stat}
+}
+
+start_groupd() {
+ ebegin "Starting groupd"
+ start-stop-daemon --start --exec ${GROUPD} --name groupd
+ eend $?
+}
+
+stop_groupd() {
+ ebegin "Stopping groupd"
+ start-stop-daemon --stop --exec ${GROUPD} --name groupd
+ eend $?
+}
+
+start_fenced() {
+ ebegin "Starting fenced"
+ start-stop-daemon --start --exec ${FENCED} --name fenced
+ eend $?
+
+ ${CMAN_TOOL} status | grep Flags | grep 2node >/dev/null 2>&1
+ local errmsg=$?
+
+ ebegin "Joining fence domain"
+ if [ "${errmsg}" -ne 0 ]
+ then
+ ${FENCE_TOOL} join -t $FENCED_START_TIMEOUT >/dev/null 2>&1
+ [ $? -eq 0 ] && errmsg=$? || errmsg=1
+ else
+ ${FENCE_TOOL} join -m $FENCED_MEMBER_DELAY >/dev/null 2>&1
+ [ $? -eq 0 ] && errmsg=$? || errmsg=1
+ fi
+ eend $errmsg
+}
+
+stop_fenced() {
+ # fenced services
+# local fence_status="$( ${CMAN_TOOL} services | awk '$1 ~ /fence/ { print $3 }')"
+# if [ -n "${fence_status}" ]; then
+# if [ -x ${FENCE_TOOL} ]; then
+# ebegin "Leaving fence domain"
+# ${FENCE_TOOL} leave > /dev/null 2>&1
+# eend $?
+# fi
+# fi
+
+ if [ -x ${FENCE_TOOL} ]; then
+ if ${FENCE_TOOL} ls >/dev/null 2>&1; then
+ ebegin "Leaving fence domain"
+ ${FENCE_TOOL} leave > /dev/null 2>&1
+ eend $?
+ fi
+ fi
+
+ ebegin "Stopping fenced"
+ start-stop-daemon --stop --exec ${FENCED} --name fenced
+ eend $?
+}
+
+start_gfs_controld() {
+ ebegin "Starting gfs_controld"
+ start-stop-daemon --start --exec ${GFS_CONTROLD} --name gfs_controld
+ eend $?
+}
+
+stop_gfs_controld() {
+ ebegin "Stopping gfs_controld"
+ start-stop-daemon --stop --exec ${GFS_CONTROLD} --name gfs_controld
+ eend $?
+}
+
+start_dlm_controld() {
+ ebegin "Starting dlm_controld"
+ start-stop-daemon --start --exec ${DLM_CONTROLD} --name dlm_controld
+ eend $?
+}
+
+stop_dlm_controld() {
+ ebegin "Stopping dlm_controld"
+ start-stop-daemon --stop --exec ${DLM_CONTROLD} --name dlm_controld
+ eend $?
+}
+
+start() {
+ if ! mount_configfs ; then
+ eerror "ConfigFS & DLM are required to use cman"
+ return 1
+ fi
+
+ [ -e /sys/module/dlm ] || [ -e /sys/kernel/dlm ] || load_modules "dlm"
+ if [ ! -e /sys/kernel/dlm ]; then
+ eerror "ConfigFS & DLM are required to use cman"
+ return 1
+ fi
+ mkdir -p /var/run/cluster
+
+# start_ccsd
+ if ! start_cman ; then
+ eerror "Failed to start cman"
+ return 1
+ fi
+ if ! start_fenced; then
+ eerror "Failed to start fenced"
+ return 1
+ fi
+ if ! start_groupd; then
+ eerror "Failed to start groupd"
+ return 1
+ fi
+ if ! start_dlm_controld; then
+ eerror "Failed to start dlm_controld"
+ return 1
+ fi
+# start_gfs_controld
+}
+
+stop() {
+
+# umount GFS filesystems
+# umount_gfs_filesystems
+
+ stop_dlm_controld
+ stop_groupd
+ stop_fenced
+ stop_cman
+
+ #stop_gfs_controld
+ #stop_dlm_controld
+ #stop_groupd
+
+ unload_modules "dlm"
+# stop_ccsd
+# unload_allmodules
+ umount_configfs
+}
diff --git a/sys-cluster/cman/metadata.xml b/sys-cluster/cman/metadata.xml
new file mode 100644
index 000000000000..ca6ebb8ce738
--- /dev/null
+++ b/sys-cluster/cman/metadata.xml
@@ -0,0 +1,9 @@
+<?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>Cluster Manager</longdescription>
+</pkgmetadata>