summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-22 01:16:49 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-22 01:16:49 +0000
commitb646bfab25f8f71b216106f1db90da1021a1639b (patch)
tree3ce03f031688880744f772c9e4cf8dab6947e7e5 /sys-cluster
parentversion bump (diff)
downloadgentoo-2-b646bfab25f8f71b216106f1db90da1021a1639b.tar.gz
gentoo-2-b646bfab25f8f71b216106f1db90da1021a1639b.tar.bz2
gentoo-2-b646bfab25f8f71b216106f1db90da1021a1639b.zip
improved init script
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/cman/ChangeLog6
-rw-r--r--sys-cluster/cman/files/cman.conf3
-rwxr-xr-xsys-cluster/cman/files/cman.rc56
3 files changed, 39 insertions, 26 deletions
diff --git a/sys-cluster/cman/ChangeLog b/sys-cluster/cman/ChangeLog
index 578fc6783272..f23443d61719 100644
--- a/sys-cluster/cman/ChangeLog
+++ b/sys-cluster/cman/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-cluster/cman
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/cman/ChangeLog,v 1.8 2005/03/19 21:36:45 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/cman/ChangeLog,v 1.9 2005/03/22 01:16:49 xmerlin Exp $
+
+ 22 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/cman.conf,
+ files/cman.rc:
+ improved init script
19 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> +files/cman.conf,
+files/cman.rc, cman-1.0_pre31.ebuild:
diff --git a/sys-cluster/cman/files/cman.conf b/sys-cluster/cman/files/cman.conf
index 0396b44ed899..aceeeeb07047 100644
--- a/sys-cluster/cman/files/cman.conf
+++ b/sys-cluster/cman/files/cman.conf
@@ -19,3 +19,6 @@ CMAN_SHUTDOWN_TIMEOUT=60
# CMAN_JOIN_OPTIONS
#CMAN_JOIN_OPTS="-c ...."
+
+# CMAN_LEAVE_OPTIONS
+#CMAN_LEAVE_OPTS=""
diff --git a/sys-cluster/cman/files/cman.rc b/sys-cluster/cman/files/cman.rc
index af6ff42c5a81..d6ab69a5ee39 100755
--- a/sys-cluster/cman/files/cman.rc
+++ b/sys-cluster/cman/files/cman.rc
@@ -1,13 +1,12 @@
#!/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.2 2005/03/19 21:43:15 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/cman/files/cman.rc,v 1.3 2005/03/22 01:16:49 xmerlin Exp $
depend() {
use net
- before fence gfs
- need ccsd
- provide cman
+ need ccs
+ provide cluster-manager
}
start() {
@@ -16,37 +15,44 @@ start() {
die "<gulm> section detected in /etc/cluster/cluster.conf"
fi
- ebegin "Loading cman module"
- modprobe cman
- eend $?
+ if [ ! -d /proc/cluster/config/cman ]; then
+ ebegin "Loading cman module"
+ modprobe cman
+ eend $?
+ fi
ebegin "Starting cman"
/sbin/cman_tool -t ${CMAN_CLUSTER_TIMEOUT} \
- -w join ${CMAN_JOIN_OPTS}
- eend $?
+ -w join ${CMAN_JOIN_OPTS} > /dev/null
- # make sure that we are quorate?
- if [ ${CMAN_QUORUM_TIMEOUT} -gt 0 ]
+ if [ "$?" -ne 0 ]
then
- /sbin/cman_tool -t ${CMAN_QUORUM_TIMEOUT} -q wait
+ ewend 1 "Failed to start cman"
+ else
+ eend 0
+
+ # make sure that we are quorate?
+ if [ ${CMAN_QUORUM_TIMEOUT} -gt 0 ]
+ then
+ /sbin/cman_tool -t ${CMAN_QUORUM_TIMEOUT} -q wait
+ fi
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 $?
+ /sbin/cman_tool -t ${CMAN_SHUTDOWN_TIMEOUT} \
+ -w leave ${CMAN_LEAVE_OPTS} > /dev/null
- ebegin "Removing cman module"
- modprobe -r cman && rtrn=0
- eend $?
+ if [ "$?" -ne 0 ]
+ then
+ ewend 1 "Failed to stop cman"
+ else
+ eend 0
+ ebegin "Unloading cman kernel module"
+ modprobe -r cman
+ eend $?
+ fi
+
}