diff options
Diffstat (limited to 'sys-cluster/cman/files/cman.rc')
-rwxr-xr-x | sys-cluster/cman/files/cman.rc | 56 |
1 files changed, 31 insertions, 25 deletions
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 + } |