summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-19 21:36:45 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-19 21:36:45 +0000
commit25806e02a9e8b61376a99ece0ac13b14b77f2c53 (patch)
tree6061a082dcb83d7f66ae66f692fe052ed55945c4 /sys-cluster/cman/files
parentAdded ghc-6.4 block. Added test phase for darcs-1.0.2. (diff)
downloadhistorical-25806e02a9e8b61376a99ece0ac13b14b77f2c53.tar.gz
historical-25806e02a9e8b61376a99ece0ac13b14b77f2c53.tar.bz2
historical-25806e02a9e8b61376a99ece0ac13b14b77f2c53.zip
added gentoo compliant init/conf
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'sys-cluster/cman/files')
-rw-r--r--sys-cluster/cman/files/cman.conf21
-rwxr-xr-xsys-cluster/cman/files/cman.rc55
2 files changed, 76 insertions, 0 deletions
diff --git a/sys-cluster/cman/files/cman.conf b/sys-cluster/cman/files/cman.conf
new file mode 100644
index 000000000000..0396b44ed899
--- /dev/null
+++ b/sys-cluster/cman/files/cman.conf
@@ -0,0 +1,21 @@
+# 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 ...."
diff --git a/sys-cluster/cman/files/cman.rc b/sys-cluster/cman/files/cman.rc
new file mode 100755
index 000000000000..8215f914ba00
--- /dev/null
+++ b/sys-cluster/cman/files/cman.rc
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/cman/files/cman.rc,v 1.1 2005/03/19 21:36:45 xmerlin Exp $
+
+depend() {
+ use net
+ before fence gfs
+ need ccsd
+ provide cman
+}
+
+exefile=/sbin/cman_tool
+pidfile=/var/run/cman.pid
+
+start() {
+ if grep -qE "<[[:space:]]*gulm([[:space:]]|[>]|$)" /etc/cluster/cluster.conf
+ then
+ die "<gulm> section detected in /etc/cluster/cluster.conf"
+ fi
+
+ ebegin "Loading cman module"
+ modprobe cman
+ eend $?
+
+ ebegin "Starting cman"
+ /sbin/cman_tool -t ${CMAN_CLUSTER_TIMEOUT} \
+ -w join ${CMAN_JOIN_OPTS}
+ eend $?
+
+ # make sure that we are quorate?
+ if [ ${CMAN_QUORUM_TIMEOUT} -gt 0 ]
+ then
+ /sbin/cman_tool -t ${CMAN_QUORUM_TIMEOUT} -q wait
+ fi
+
+ ebegin "Loading dlm module"
+ modprobe dlm
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping cman"
+ /sbin/cman_tool -t ${CMAN_SHUTDOWN_TIMEOUT} -w leave > /dev/null
+ eend $?
+
+ ebegin "Removing dlm module"
+ modprobe -r dlm &>/dev/null
+ eend $?
+
+ ebegin "Removing cman module"
+ modprobe -r cman && rtrn=0
+ eend $?
+}
+