* [Cluster-devel] cluster/cman/init.d cman
@ 2006-10-30 13:20 pcaulfield
0 siblings, 0 replies; 23+ messages in thread
From: pcaulfield @ 2006-10-30 13:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2006-10-30 13:20:28
Modified files:
cman/init.d : cman
Log message:
Lon's patch to user /etc/sysconfig/cman for customisation.
bz#212393
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.25&r2=1.26
--- cluster/cman/init.d/cman 2006/10/18 21:48:41 1.25
+++ cluster/cman/init.d/cman 2006/10/30 13:20:27 1.26
@@ -8,35 +8,38 @@
# Provides:
### END INIT INFO
. /etc/init.d/functions
-CCSD_OPTS=
+
+[ -f /etc/sysconfig/cman ] && . /etc/sysconfig/cman
+[ -z "$CCSD_OPTS" ] && 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
+[ -z "$CMAN_CLUSTER_TIMEOUT" ] && 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_QUORUM_TIMEOUT=0
+[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0
# 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
+[ -z "$CMAN_SHUTDOWN_TIMEOUT" ] && CMAN_SHUTDOWN_TIMEOUT=60
# FENCED_START_TIMEOUT -- amount of time to wait for starting fenced
# before giving up. If FENCED_START_TIMEOUT is positive, then we will
# wait FENCED_START_TIMEOUT seconds before giving up and failing when
# fenced does not start. If FENCED_START_TIMEOUT is zero, then
# wait indefinately for fenced to start.
-FENCED_START_TIMEOUT=300
+[ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300
-LOCK_FILE="/var/lock/subsys/cman"
+[ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/subsys/cman"
[ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Cluster-devel] cluster/cman/init.d cman
@ 2008-01-18 16:47 adas
0 siblings, 0 replies; 23+ messages in thread
From: adas @ 2008-01-18 16:47 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: adas at sourceware.org 2008-01-18 16:47:14
Modified files:
cman/init.d : cman
Log message:
lon's patch removes 'Domain-0' check which was breaking xvm because cman starts before xend. patch also allows you to put NODENAME in /etc/sysconfig/cluster
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26.2.5&r2=1.26.2.6
--- cluster/cman/init.d/Attic/cman 2007/07/17 16:09:59 1.26.2.5
+++ cluster/cman/init.d/Attic/cman 2008/01/18 16:47:14 1.26.2.6
@@ -43,6 +43,8 @@
[ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
+[ -n "$NODENAME" ] && cman_join_opts+=" -n $NODENAME"
+
load_modules()
{
errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
@@ -186,12 +188,6 @@
which xm &> /dev/null || return 1
#
- # Check for presence of Domain-0; if it's not there, we can't
- # run xvmd.
- #
- xm list --long 2> /dev/null | grep -q "Domain-0" || return 1
-
- #
# Check for presence of /cluster/fence_xvmd in cluster.conf
# (If -X is specified, it doesn't matter if it's in cluster.conf;
# we'll start it anyway since ccsd is not required)
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-12-11 14:04 pcaulfield
0 siblings, 0 replies; 23+ messages in thread
From: pcaulfield @ 2007-12-11 14:04 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2007-12-11 14:04:27
Modified files:
cman/init.d : cman
Log message:
Some small fixes to the networking param code, thanks to Fabio on IRC
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.33&r2=1.34
--- cluster/cman/init.d/cman 2007/12/11 11:22:10 1.33
+++ cluster/cman/init.d/cman 2007/12/11 14:04:26 1.34
@@ -216,17 +216,22 @@
set_networking_params()
{
- value=`cat /proc/sys/net/core/rmem_default`
- if [ $value -le $NET_RMEM_DEFAULT ]
- then
- echo $NET_RMEM_DEFAULT > /proc/sys/net/core/rmem_default
- fi
-
- value=`cat /proc/sys/net/core/rmem_max`
- if [ $value -le $NET_RMEM_MAX ]
+ if [ ! -f /proc/sys/net/core/rmem_default ]
+ then
+ return 0;
+ fi
+
+ value="$(cat /proc/sys/net/core/rmem_default)"
+ if [ $value -le $NET_RMEM_DEFAULT ]
+ then
+ echo $NET_RMEM_DEFAULT > /proc/sys/net/core/rmem_default
+ fi
+
+ value="$(cat /proc/sys/net/core/rmem_max)"
+ if [ $value -le $NET_RMEM_MAX ]
then
- echo $NET_RMEM_MAX > /proc/sys/net/core/rmem_max
- fi
+ echo $NET_RMEM_MAX > /proc/sys/net/core/rmem_max
+ fi
}
start()
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-12-11 11:22 pcaulfield
0 siblings, 0 replies; 23+ messages in thread
From: pcaulfield @ 2007-12-11 11:22 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2007-12-11 11:22:10
Modified files:
cman/init.d : cman
Log message:
Set networking parameters suitable for running DLM over sctp
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.32&r2=1.33
--- cluster/cman/init.d/cman 2007/07/12 19:50:16 1.32
+++ cluster/cman/init.d/cman 2007/12/11 11:22:10 1.33
@@ -39,6 +39,16 @@
# wait indefinately for fenced to start.
[ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300
+# NET_RMEM_DEFAULT -- minimum value for rmem_default. If this is set
+# higher elsewhere it will not be reduced here.
+# These two values are only really needed for the DLM when using sctp
+# but do no harm.
+[ -z "$NET_RMEM_DEFAULT" ] && NET_RMEM_DEFAULT=4194304
+
+# NET_RMEM_MAX -- minimum value for rmem_max. If this is set
+# higher elsewhere it will not be reduced here.
+[ -z "$NET_RMEM_MAX" ] && NET_RMEM_MAX=4194304
+
[ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/subsys/cman"
[ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
@@ -204,6 +214,21 @@
return 0
}
+set_networking_params()
+{
+ value=`cat /proc/sys/net/core/rmem_default`
+ if [ $value -le $NET_RMEM_DEFAULT ]
+ then
+ echo $NET_RMEM_DEFAULT > /proc/sys/net/core/rmem_default
+ fi
+
+ value=`cat /proc/sys/net/core/rmem_max`
+ if [ $value -le $NET_RMEM_MAX ]
+ then
+ echo $NET_RMEM_MAX > /proc/sys/net/core/rmem_max
+ fi
+}
+
start()
{
echo "Starting cluster: "
@@ -240,6 +265,15 @@
echo "failed"
return 1
fi
+ echo -n " Setting network parameters... "
+ set_networking_params
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
echo -n " Starting ccsd... "
start_ccsd
if [ $? -eq 0 ]
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-07-17 16:10 rmccabe
0 siblings, 0 replies; 23+ messages in thread
From: rmccabe @ 2007-07-17 16:10 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-07-17 16:09:59
Modified files:
cman/init.d : cman
Log message:
Fix 248048: xen network workaround not enabled when additional params are given to network-bridge script
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26.2.4&r2=1.26.2.5
--- cluster/cman/init.d/cman 2007/05/10 14:45:14 1.26.2.4
+++ cluster/cman/init.d/cman 2007/07/17 16:09:59 1.26.2.5
@@ -153,7 +153,7 @@
return 1
fi
- egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >/dev/null 2>/dev/null
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')*[[:blank:]]*network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >&/dev/null
if [ $? -ne 0 ]; then
# xend isn't configured to use bridged networking.
return 1
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-07-12 19:50 rmccabe
0 siblings, 0 replies; 23+ messages in thread
From: rmccabe @ 2007-07-12 19:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rmccabe at sourceware.org 2007-07-12 19:50:17
Modified files:
cman/init.d : cman
Log message:
Detect bridged networking configurations where additional parameters are supplied to the script.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.31&r2=1.32
--- cluster/cman/init.d/cman 2007/05/10 14:36:19 1.31
+++ cluster/cman/init.d/cman 2007/07/12 19:50:16 1.32
@@ -153,7 +153,7 @@
return 1
fi
- egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >/dev/null 2>/dev/null
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')*[[:blank:]]*network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >&/dev/null
if [ $? -ne 0 ]; then
# xend isn't configured to use bridged networking.
return 1
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-05-10 21:45 rmccabe
0 siblings, 0 replies; 23+ messages in thread
From: rmccabe @ 2007-05-10 21:45 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL50
Changes by: rmccabe at sourceware.org 2007-05-10 21:45:58
Modified files:
cman/init.d : cman
Log message:
Don't workaround xend bridged networking on non-xen kernels.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.26.4.3&r2=1.26.4.4
--- cluster/cman/init.d/cman 2007/04/27 22:08:40 1.26.4.3
+++ cluster/cman/init.d/cman 2007/05/10 21:45:58 1.26.4.4
@@ -133,6 +133,9 @@
}
xend_bridged_net_enabled() {
+ # Not a xen kernel
+ test -d /proc/xen || return 1
+
current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
if [ -z "$current_runlevel" ]; then
errmsg='Unable to determine the current runlevel'
@@ -150,7 +153,7 @@
return 1
fi
- egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp 2>/dev/null
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
# xend isn't configured to use bridged networking.
return 1
@@ -296,7 +299,10 @@
if [ $? -eq 0 ]
then
errmsg=$( /bin/umount /sys/kernel/config 2>&1 )
- return $?
+ if [ $? -ne 0 ]
+ then
+ echo -n $errmsg " "
+ fi
fi
return 0
}
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-05-10 14:45 rmccabe
0 siblings, 0 replies; 23+ messages in thread
From: rmccabe @ 2007-05-10 14:45 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-05-10 14:45:14
Modified files:
cman/init.d : cman
Log message:
Don't workaround xend bridged networking on non-xen kernels.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26.2.3&r2=1.26.2.4
--- cluster/cman/init.d/cman 2006/12/08 22:01:16 1.26.2.3
+++ cluster/cman/init.d/cman 2007/05/10 14:45:14 1.26.2.4
@@ -132,6 +132,50 @@
return 0
}
+xend_bridged_net_enabled() {
+ # Not a xen kernel
+ test -d /proc/xen || return 1
+
+ current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
+ if [ -z "$current_runlevel" ]; then
+ errmsg='Unable to determine the current runlevel'
+ return 1
+ fi
+
+ /sbin/chkconfig --levels "$current_runlevel" xend 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # xend doesn't start at this runlevel.
+ return 1
+ fi
+
+ if [ ! -f /etc/xen/xend-config.sxp ]; then
+ # xend isn't configured to use bridged networking.
+ return 1
+ fi
+
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >/dev/null 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # xend isn't configured to use bridged networking.
+ return 1
+ fi
+ return 0
+}
+
+xend_bridged_net_start() {
+ if [ ! -x /etc/xen/scripts/network-bridge ]; then
+ if [ -f /etc/xen/scripts/network-bridge ]; then
+ errmsg='The xend bridged network script cannot be run'
+ else
+ errmsg='The xend bridged network script is missing'
+ fi
+ return 1
+ fi
+
+ /sbin/modprobe netbk >& /dev/null
+ /sbin/modprobe netloop >& /dev/null
+ errmsg=$(/etc/xen/scripts/network-bridge start 2>&1) || return 1
+ return 0
+}
fence_xvmd_enabled()
{
@@ -163,6 +207,20 @@
start()
{
echo "Starting cluster: "
+
+ xend_bridged_net_enabled
+ if [ $? -eq 0 ]
+ then
+ echo -n " Enabling workaround for Xend bridged networking... "
+ xend_bridged_net_start
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed: $errmsg"
+ return 1
+ fi
+ fi
echo -n " Loading modules... "
ulimit -c unlimited
load_modules
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-05-10 14:36 rmccabe
0 siblings, 0 replies; 23+ messages in thread
From: rmccabe @ 2007-05-10 14:36 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rmccabe at sourceware.org 2007-05-10 14:36:21
Modified files:
cman/init.d : cman
Log message:
don't try to workaround xend networking when running on a non-xen kernel
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.30&r2=1.31
--- cluster/cman/init.d/cman 2007/04/27 15:07:10 1.30
+++ cluster/cman/init.d/cman 2007/05/10 14:36:19 1.31
@@ -133,6 +133,9 @@
}
xend_bridged_net_enabled() {
+ # Not a xen kernel
+ test -d /proc/xen || return 1
+
current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
if [ -z "$current_runlevel" ]; then
errmsg='Unable to determine the current runlevel'
@@ -150,7 +153,7 @@
return 1
fi
- egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp 2>/dev/null
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
# xend isn't configured to use bridged networking.
return 1
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-04-27 22:08 cfeist
0 siblings, 0 replies; 23+ messages in thread
From: cfeist @ 2007-04-27 22:08 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL50
Changes by: cfeist at sourceware.org 2007-04-27 23:08:40
Modified files:
cman/init.d : cman
Log message:
Work around network disruption caused by XenD's bridged networking (bz230783, bz231227). (rmmcabe)
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.26.4.2&r2=1.26.4.3
--- cluster/cman/init.d/cman 2006/11/15 16:55:16 1.26.4.2
+++ cluster/cman/init.d/cman 2007/04/27 22:08:40 1.26.4.3
@@ -132,6 +132,47 @@
return 0
}
+xend_bridged_net_enabled() {
+ current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
+ if [ -z "$current_runlevel" ]; then
+ errmsg='Unable to determine the current runlevel'
+ return 1
+ fi
+
+ /sbin/chkconfig --levels "$current_runlevel" xend 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # xend doesn't start at this runlevel.
+ return 1
+ fi
+
+ if [ ! -f /etc/xen/xend-config.sxp ]; then
+ # xend isn't configured to use bridged networking.
+ return 1
+ fi
+
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # xend isn't configured to use bridged networking.
+ return 1
+ fi
+ return 0
+}
+
+xend_bridged_net_start() {
+ if [ ! -x /etc/xen/scripts/network-bridge ]; then
+ if [ -f /etc/xen/scripts/network-bridge ]; then
+ errmsg='The xend bridged network script cannot be run'
+ else
+ errmsg='The xend bridged network script is missing'
+ fi
+ return 1
+ fi
+
+ /sbin/modprobe netbk >& /dev/null
+ /sbin/modprobe netloop >& /dev/null
+ errmsg=$(/etc/xen/scripts/network-bridge start 2>&1) || return 1
+ return 0
+}
fence_xvmd_enabled()
{
@@ -163,6 +204,20 @@
start()
{
echo "Starting cluster: "
+
+ xend_bridged_net_enabled
+ if [ $? -eq 0 ]
+ then
+ echo -n " Enabling workaround for Xend bridged networking... "
+ xend_bridged_net_start
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed: $errmsg"
+ return 1
+ fi
+ fi
echo -n " Loading modules... "
ulimit -c unlimited
load_modules
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2007-04-27 15:07 rmccabe
0 siblings, 0 replies; 23+ messages in thread
From: rmccabe @ 2007-04-27 15:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rmccabe at sourceware.org 2007-04-27 16:07:10
Modified files:
cman/init.d : cman
Log message:
Work around network disruption caused by XenD's bridged networking (bz230783, bz231227).
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.29&r2=1.30
--- cluster/cman/init.d/cman 2006/12/08 22:01:22 1.29
+++ cluster/cman/init.d/cman 2007/04/27 15:07:10 1.30
@@ -132,6 +132,47 @@
return 0
}
+xend_bridged_net_enabled() {
+ current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
+ if [ -z "$current_runlevel" ]; then
+ errmsg='Unable to determine the current runlevel'
+ return 1
+ fi
+
+ /sbin/chkconfig --levels "$current_runlevel" xend 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # xend doesn't start at this runlevel.
+ return 1
+ fi
+
+ if [ ! -f /etc/xen/xend-config.sxp ]; then
+ # xend isn't configured to use bridged networking.
+ return 1
+ fi
+
+ egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # xend isn't configured to use bridged networking.
+ return 1
+ fi
+ return 0
+}
+
+xend_bridged_net_start() {
+ if [ ! -x /etc/xen/scripts/network-bridge ]; then
+ if [ -f /etc/xen/scripts/network-bridge ]; then
+ errmsg='The xend bridged network script cannot be run'
+ else
+ errmsg='The xend bridged network script is missing'
+ fi
+ return 1
+ fi
+
+ /sbin/modprobe netbk >& /dev/null
+ /sbin/modprobe netloop >& /dev/null
+ errmsg=$(/etc/xen/scripts/network-bridge start 2>&1) || return 1
+ return 0
+}
fence_xvmd_enabled()
{
@@ -163,6 +204,20 @@
start()
{
echo "Starting cluster: "
+
+ xend_bridged_net_enabled
+ if [ $? -eq 0 ]
+ then
+ echo -n " Enabling workaround for Xend bridged networking... "
+ xend_bridged_net_start
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed: $errmsg"
+ return 1
+ fi
+ fi
echo -n " Loading modules... "
ulimit -c unlimited
load_modules
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-12-08 22:01 adas
0 siblings, 0 replies; 23+ messages in thread
From: adas @ 2006-12-08 22:01 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: adas at sourceware.org 2006-12-08 22:01:22
Modified files:
cman/init.d : cman
Log message:
don't fail if unmounting configfs fails
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.28&r2=1.29
--- cluster/cman/init.d/cman 2006/11/15 16:55:35 1.28
+++ cluster/cman/init.d/cman 2006/12/08 22:01:22 1.29
@@ -241,7 +241,10 @@
if [ $? -eq 0 ]
then
errmsg=$( /bin/umount /sys/kernel/config 2>&1 )
- return $?
+ if [ $? -ne 0 ]
+ then
+ echo -n $errmsg " "
+ fi
fi
return 0
}
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-12-08 22:01 adas
0 siblings, 0 replies; 23+ messages in thread
From: adas @ 2006-12-08 22:01 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: adas at sourceware.org 2006-12-08 22:01:16
Modified files:
cman/init.d : cman
Log message:
don't fail if unmounting configfs fails
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26.2.2&r2=1.26.2.3
--- cluster/cman/init.d/cman 2006/11/15 16:54:51 1.26.2.2
+++ cluster/cman/init.d/cman 2006/12/08 22:01:16 1.26.2.3
@@ -241,7 +241,10 @@
if [ $? -eq 0 ]
then
errmsg=$( /bin/umount /sys/kernel/config 2>&1 )
- return $?
+ if [ $? -ne 0 ]
+ then
+ echo -n $errmsg " "
+ fi
fi
return 0
}
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-11-15 16:55 lhh
0 siblings, 0 replies; 23+ messages in thread
From: lhh @ 2006-11-15 16:55 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2006-11-15 16:55:35
Modified files:
cman/init.d : cman
Log message:
Fix error reporting from cman if run while xend is not running.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.27&r2=1.28
--- cluster/cman/init.d/cman 2006/11/13 16:13:51 1.27
+++ cluster/cman/init.d/cman 2006/11/15 16:55:35 1.28
@@ -145,7 +145,7 @@
# Check for presence of Domain-0; if it's not there, we can't
# run xvmd.
#
- xm list --long | grep -q "Domain-0" || return 1
+ xm list --long 2> /dev/null | grep -q "Domain-0" || return 1
#
# Check for presence of /cluster/fence_xvmd in cluster.conf
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-11-15 16:55 lhh
0 siblings, 0 replies; 23+ messages in thread
From: lhh @ 2006-11-15 16:55 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL50
Changes by: lhh at sourceware.org 2006-11-15 16:55:16
Modified files:
cman/init.d : cman
Log message:
Fix error reporting from cman if run while xend is not running.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.26.4.1&r2=1.26.4.2
--- cluster/cman/init.d/cman 2006/11/13 16:14:18 1.26.4.1
+++ cluster/cman/init.d/cman 2006/11/15 16:55:16 1.26.4.2
@@ -145,7 +145,7 @@
# Check for presence of Domain-0; if it's not there, we can't
# run xvmd.
#
- xm list --long | grep -q "Domain-0" || return 1
+ xm list --long 2> /dev/null | grep -q "Domain-0" || return 1
#
# Check for presence of /cluster/fence_xvmd in cluster.conf
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-11-15 16:54 lhh
0 siblings, 0 replies; 23+ messages in thread
From: lhh @ 2006-11-15 16:54 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2006-11-15 16:54:51
Modified files:
cman/init.d : cman
Log message:
Fix error reporting from cman if run while xend is not running.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.26.2.1&r2=1.26.2.2
--- cluster/cman/init.d/cman 2006/11/13 16:14:06 1.26.2.1
+++ cluster/cman/init.d/cman 2006/11/15 16:54:51 1.26.2.2
@@ -145,7 +145,7 @@
# Check for presence of Domain-0; if it's not there, we can't
# run xvmd.
#
- xm list --long | grep -q "Domain-0" || return 1
+ xm list --long 2> /dev/null | grep -q "Domain-0" || return 1
#
# Check for presence of /cluster/fence_xvmd in cluster.conf
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-10-18 21:48 rpeterso
0 siblings, 0 replies; 23+ messages in thread
From: rpeterso @ 2006-10-18 21:48 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2006-10-18 21:48:42
Modified files:
cman/init.d : cman
Log message:
This is the fix for bugzilla bug 211337: must create core files
for daemons on segfault.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.24&r2=1.25
--- cluster/cman/init.d/cman 2006/10/13 14:57:55 1.24
+++ cluster/cman/init.d/cman 2006/10/18 21:48:41 1.25
@@ -124,6 +124,7 @@
{
echo "Starting cluster: "
echo -n " Loading modules... "
+ ulimit -c unlimited
load_modules
if [ $? -eq 0 ]
then
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-10-04 20:32 rpeterso
0 siblings, 0 replies; 23+ messages in thread
From: rpeterso @ 2006-10-04 20:32 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2006-10-04 20:32:06
Modified files:
cman/init.d : cman
Log message:
Add -w option back to fence_tool join in cman init script.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.22&r2=1.23
--- cluster/cman/init.d/cman 2006/09/18 15:49:01 1.22
+++ cluster/cman/init.d/cman 2006/10/04 20:32:05 1.23
@@ -115,7 +115,7 @@
start_fence()
{
- errmsg=$( /sbin/fence_tool -j $FENCED_START_TIMEOUT join \
+ errmsg=$( /sbin/fence_tool -w -j $FENCED_START_TIMEOUT join \
> /dev/null 2>&1 ) || return 1
return 0
}
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-08-31 18:00 rohara
0 siblings, 0 replies; 23+ messages in thread
From: rohara @ 2006-08-31 18:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rohara at sourceware.org 2006-08-31 18:00:03
Modified files:
cman/init.d : cman
Log message:
ccsd is now fixed such that it will not daemonize until the socket is ready
for communication. As a result, the sleep after starting ccsd is no longer
needed.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.20&r2=1.21
--- cluster/cman/init.d/cman 2006/08/25 22:04:42 1.20
+++ cluster/cman/init.d/cman 2006/08/31 18:00:03 1.21
@@ -69,8 +69,6 @@
then
errmsg=$(/sbin/ccsd $CCSD_OPTS 2>&1)
rtrn=$?
- # give ccsd time to start up before we start cman
- sleep 1
return $rtrn
fi
return 0
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-08-25 22:04 adas
0 siblings, 0 replies; 23+ messages in thread
From: adas @ 2006-08-25 22:04 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: adas at sourceware.org 2006-08-25 22:04:42
Modified files:
cman/init.d : cman
Log message:
fix for bz 203167 and bz 202984. stop_fence was commented out. Now we do stop_fence before doing a cman_tool leave.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.19&r2=1.20
--- cluster/cman/init.d/cman 2006/07/21 21:02:06 1.19
+++ cluster/cman/init.d/cman 2006/08/25 22:04:42 1.20
@@ -68,9 +68,10 @@
if [ $? -ne 0 ]
then
errmsg=$(/sbin/ccsd $CCSD_OPTS 2>&1)
+ rtrn=$?
# give ccsd time to start up before we start cman
sleep 1
- return $?
+ return $rtrn
fi
return 0
}
@@ -123,19 +124,61 @@
start()
{
- echo -n "Starting cluster: "
+ echo "Starting cluster: "
+ echo -n " Loading modules... "
load_modules
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Mounting configfs... "
start_configfs
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Starting ccsd... "
start_ccsd
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Starting cman... "
start_cman
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Starting daemons... "
start_daemons
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Starting fencing... "
start_fence
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
return 0
}
@@ -206,28 +249,59 @@
if /sbin/pidof fenced &> /dev/null
then
/sbin/fence_tool leave > /dev/null 2>&1
- return $?
+ rtrn=$?
+ sleep 1 # A bit of time for fenced to exit
+ return $rtrn
fi
return 0 # all ok
}
stop()
{
- echo -n "Stopping cluster: "
+ echo "Stopping cluster: "
+ echo -n " Stopping fencing... "
+ stop_fence
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Stopping cman... "
if [ $1 ]; then
stop_cman $1
else
stop_cman
fi
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
# stop_daemons
# [ $? -ne 0 ] && return 1
- stop_fence
-# [ $? -ne 0 ] && return 1
+ echo -n " Stopping ccsd... "
stop_ccsd
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+ echo -n " Unmounting configfs... "
stop_configfs
- [ $? -ne 0 ] && return 1
+ if [ $? -eq 0 ]
+ then
+ echo "done"
+ else
+ echo "failed"
+ return 1
+ fi
+
return 0
}
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-07-21 21:02 rpeterso
0 siblings, 0 replies; 23+ messages in thread
From: rpeterso @ 2006-07-21 21:02 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2006-07-21 21:02:07
Modified files:
cman/init.d : cman
Log message:
Moved cman_tool from /sbin to /usr/sbin
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.18&r2=1.19
--- cluster/cman/init.d/cman 2006/07/20 20:19:47 1.18
+++ cluster/cman/init.d/cman 2006/07/21 21:02:06 1.19
@@ -78,15 +78,15 @@
start_cman()
{
# cman
- /sbin/cman_tool status &> /dev/null
+ /usr/sbin/cman_tool status &> /dev/null
if [ $? -ne 0 ]
then
- errmsg=$( /sbin/cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
+ errmsg=$( /usr/sbin/cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
$cman_join_opts 2>&1 ) || return 1
if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]
then
- errmsg=$( /sbin/cman_tool -t $CMAN_QUORUM_TIMEOUT \
+ errmsg=$( /usr/sbin/cman_tool -t $CMAN_QUORUM_TIMEOUT \
-q wait 2>&1 ) || return 1
fi
fi
@@ -175,10 +175,10 @@
stop_cman()
{
- /sbin/cman_tool status &> /dev/null
+ /usr/sbin/cman_tool status &> /dev/null
if [ $? -eq 0 ]
then
- errmsg=$( /sbin/cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \
+ errmsg=$( /usr/sbin/cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \
-w leave $1 2>&1 ) || return 1
fi
return 0 # all ok
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-07-20 20:19 rpeterso
0 siblings, 0 replies; 23+ messages in thread
From: rpeterso @ 2006-07-20 20:19 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2006-07-20 20:19:47
Modified files:
cman/init.d : cman
Log message:
Service stop was killing daemons, which hung system at umount time.
Also, service status would hang when cluster was down.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.17&r2=1.18
--- cluster/cman/init.d/cman 2006/06/29 18:58:31 1.17
+++ cluster/cman/init.d/cman 2006/07/20 20:19:47 1.18
@@ -44,7 +44,6 @@
{
errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
errmsg=$( /sbin/modprobe dlm 2>&1 ) || return 1
- errmsg=$( /sbin/modprobe dlm_device 2>&1 ) || return 1
errmsg=$( /sbin/modprobe lock_dlm 2>&1 ) || return 1
return 0
}
@@ -69,6 +68,8 @@
if [ $? -ne 0 ]
then
errmsg=$(/sbin/ccsd $CCSD_OPTS 2>&1)
+ # give ccsd time to start up before we start cman
+ sleep 1
return $?
fi
return 0
@@ -186,16 +187,16 @@
stop_daemons()
{
if pid=$(/sbin/pidof gfs_controld 2>&1); then
- errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
fi
if pid=$(/sbin/pidof dlm_controld 2>&1); then
- errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
fi
if pid=$(/sbin/pidof fenced 2>&1); then
- errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
fi
if pid=$(/sbin/pidof groupd 2>&1); then
- errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ errmsg=$(/usr/bin/kill $pid 2>&1) || return 1
fi
return 0 # all ok
}
@@ -213,16 +214,16 @@
stop()
{
echo -n "Stopping cluster: "
- stop_fence
- [ $? -ne 0 ] && return 1
- stop_daemons
- [ $? -ne 0 ] && return 1
if [ $1 ]; then
stop_cman $1
else
stop_cman
fi
[ $? -ne 0 ] && return 1
+# stop_daemons
+# [ $? -ne 0 ] && return 1
+ stop_fence
+# [ $? -ne 0 ] && return 1
stop_ccsd
[ $? -ne 0 ] && return 1
stop_configfs
@@ -230,6 +231,16 @@
return 0
}
+cmanstatus()
+{
+ errmsg=$( status ccsd 2>&1) || return 1
+ errmsg=$( status groupd 2>&1) || return 1
+ errmsg=$( status fenced 2>&1) || return 1
+ errmsg=$( status dlm_controld 2>&1) || return 1
+ errmsg=$( status gfs_controld 2>&1) || return 1
+ return 0
+}
+
rtrn=1
# See how we were called.
@@ -274,8 +285,13 @@
;;
status)
- /sbin/cman_tool status 2>/dev/null
+ cmanstatus
rtrn=$?
+ if [ $rtrn -ne 0 ] ; then
+ echo $errmsg
+ else
+ echo "cman is running."
+ fi
;;
*)
^ permalink raw reply [flat|nested] 23+ messages in thread* [Cluster-devel] cluster/cman/init.d cman
@ 2006-06-28 20:57 adas
0 siblings, 0 replies; 23+ messages in thread
From: adas @ 2006-06-28 20:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: adas at sourceware.org 2006-06-28 20:57:03
Modified files:
cman/init.d : cman
Log message:
Single init script to start up cluster: Covers loading of modules, starting ccsd, cman and fencing, and starting daemons. Replaces ccsd, cman and fenced init scripts
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&r1=1.15&r2=1.16
--- cluster/cman/init.d/cman 2006/05/08 22:38:29 1.15
+++ cluster/cman/init.d/cman 2006/06/28 20:57:03 1.16
@@ -3,11 +3,12 @@
# chkconfig: 345 21 79
# description: Starts and stops cman
#
-#
+#
### BEGIN INIT INFO
-# Provides:
+# Provides:
### END INIT INFO
-
+. /etc/init.d/functions
+CCSD_OPTS=-X
# 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
@@ -20,166 +21,265 @@
# 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_QUORUM_TIMEOUT=300
+CMAN_QUORUM_TIMEOUT=0
# 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
-. /etc/init.d/functions
-[ -f /etc/sysconfig/cluster ] && . /etc/sysconfig/cluster
+# FENCED_START_TIMEOUT -- amount of time to wait for starting fenced
+# before giving up. If FENCED_START_TIMEOUT is positive, then we will
+# wait FENCED_START_TIMEOUT seconds before giving up and failing when
+# fenced does not start. If FENCED_START_TIMEOUT is zero, then
+# wait indefinately for fenced to start.
+FENCED_START_TIMEOUT=120
LOCK_FILE="/var/lock/subsys/cman"
[ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
-in_cluster()
+load_modules()
{
- grep -q "Cluster Member: Yes" /proc/cluster/status
+ errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
+ errmsg=$( /sbin/modprobe dlm 2>&1 ) || return 1
+ errmsg=$( /sbin/modprobe dlm_device 2>&1 ) || return 1
+ return 0
}
-start()
+start_configfs()
+{
+ # 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
+ errmsg=$( /bin/mount -t configfs none /sys/kernel/config 2>&1 )
+ return $?
+ fi
+ return 0
+}
+
+start_ccsd()
+{
+ # ccsd
+ status ccsd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ errmsg=$(/sbin/ccsd $CCSD_OPTS 2>&1)
+ return $?
+ fi
+ return 0
+}
+
+start_cman()
{
- echo -n "Starting cman:"
+ # cman
+ /sbin/cman_tool status &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ errmsg=$( /sbin/cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
+ $cman_join_opts 2>&1 ) || return 1
- # If gulm is in ccs, don't start cman
- # FIXME -- Should this be silent? I think users should get some
- # feedback, but others might not want added verbosity to
- # the boot process. Oh well... it's only one line :)
- if ! [ -r /etc/cluster/cluster.conf ]
- then
- # TODO -- cman can start w/out cluster.conf file. This
- # should not stop cman from starting up.
- initlog -n ${0##*/} -s "/etc/cluster/cluster.conf was not detected"
- elif grep -qE "<[[:space:]]*gulm([[:space:]]|[>]|$)" \
- /etc/cluster/cluster.conf
+ if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]
then
- warning "Skipping because of <gulm> section detected in " \
- "/etc/cluster/cluster.conf"
- echo
- exit 0
+ errmsg=$( /sbin/cman_tool -t $CMAN_QUORUM_TIMEOUT \
+ -q wait 2>&1 ) || return 1
fi
+ fi
+ return 0
+}
- rtrn=1
+start_daemons()
+{
+ status groupd &> /dev/null
+ if [ $? -ne 0 ]; then
+ errmsg=$( /sbin/groupd 2>&1 ) || return 1
+ fi
+ status fenced &> /dev/null
+ if [ $? -ne 0 ]; then
+ errmsg=$( /sbin/fenced 2>&1 ) || return 1
+ fi
+ status dlm_controld &> /dev/null
+ if [ $? -ne 0 ]; then
+ errmsg=$( /sbin/dlm_controld 2>&1 ) || return 1
+ fi
+ status gfs_controld &> /dev/null
+ if [ $? -ne 0 ]; then
+ errmsg=$( /sbin/gfs_controld 2>&1 ) || return 1
+ fi
+ return 0
+}
- for try in block
- do
- # load the cman module (modprobe won't error if the modules
- # are already loaded
- errmsg=$(modprobe cman 2>&1) || break
-
- # try to load the dlm module
- modprobe dlm &> /dev/null
-
- # TODO -- configure tunable paramters?
- # [ -n "$CMAN_TRANSITION_RESTARTS" ] &&
- # echo $CMAN_TRANSITION_RESTARTS > \
- # /proc/cluster/config/cman/transition_restarts
-
- if in_cluster
- then
- rtrn=0
- break
- fi
-
- # specify -w to make sure we have joined the cluster
- # TODO -- should we call cman_tool leave if this times out?
- errmsg=$(cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
- $cman_join_opts 2>&1) || break
-
- # make sure that we are quorate?
- if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]
- then
- errmsg=$( cman_tool -t $CMAN_QUORUM_TIMEOUT \
- -q wait 2>&1 ) || break
- fi
+start_fence()
+{
+ errmsg=$( /sbin/fence_tool -j $FENCED_START_TIMEOUT join \
+ > /dev/null 2>&1 ) || return 1
+ return 0
+}
- rtrn=0
- done
+start()
+{
+ echo -n "Starting cluster: "
+ load_modules
+ [ $? -ne 0 ] && return 1
+ start_configfs
+ [ $? -ne 0 ] && return 1
+ start_ccsd
+ [ $? -ne 0 ] && return 1
+ start_cman
+ [ $? -ne 0 ] && return 1
+ start_daemons
+ [ $? -ne 0 ] && return 1
+ start_fence
+ [ $? -ne 0 ] && return 1
+
+ return 0
+}
+
+stop_configfs()
+{
+ awk '{ print $2 }' /etc/mtab | grep "/sys/kernel/config" &> /dev/null\
+ && awk '{ print $3 }' /etc/mtab | grep "configfs" &> /dev/null
+ if [ $? -eq 0 ]
+ then
+ errmsg=$( /bin/umount /sys/kernel/config 2>&1 )
+ return $?
+ fi
+ return 0
+}
- if [ $rtrn -eq 0 ]
+stop_ccsd()
+{
+ for sec in $(seq 1 10)
+ do
+ if /sbin/pidof ccsd &> /dev/null
then
- success "startup"
- echo
+ # get the pid of ccsd from /var/run/cluster/ccsd.pid
+ # and break if the file is not there
+ [ -r /var/run/cluster/ccsd.pid ] || break
+
+ pid=$(cat /var/run/cluster/ccsd.pid)
+ /usr/bin/kill $pid &> /dev/null || break
+
+ sleep 1
else
- failure "$errmsg"
- echo
+ return 0
fi
-
- # need the extra echo to properlly terminate the line
- return $rtrn
+ done
+ return 1
}
-# This function can be called with an additional argument, remove
-# The cman_tool command will fail if the additional argument is
-# something else.
-stop()
+stop_cman()
{
- echo -n "Stopping cman:"
- rtrn=0
- if [ -r /proc/cluster/status ]
- then
- rtrn=1
+ /sbin/cman_tool status &> /dev/null
+ if [ $? -eq 0 ]
+ then
+ errmsg=$( /sbin/cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \
+ -w leave $1 2>&1 ) || return 1
+ fi
+ return 0 # all ok
+}
- cman_tool -t $CMAN_SHUTDOWN_TIMEOUT -w leave $1 &> /dev/null && rtrn=0
+stop_daemons()
+{
+ if pid=$(/sbin/pidof gfs_controld 2>&1); then
+ errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ fi
+ if pid=$(/sbin/pidof dlm_controld 2>&1); then
+ errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ fi
+ if pid=$(/sbin/pidof fenced 2>&1); then
+ errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ fi
+ if pid=$(/sbin/pidof groupd 2>&1); then
+ errmsg=$(/usr/bin/kill -9 $pid 2>&1) || return 1
+ fi
+ return 0 # all ok
+}
- # allow cman time to clean up BZ 149282
- sleep 3
+stop_fence()
+{
+ if /sbin/pidof fenced &> /dev/null
+ then
+ /sbin/fence_tool leave > /dev/null 2>&1
+ return $?
+ fi
+ return 0 # all ok
+}
- # try to unload dlm module
- modprobe -r dlm &>/dev/null
-
- modprobe -r cman &>/dev/null
- fi
-
- if [ $rtrn -eq 0 ]
- then
- success "shutdown"
- echo
- else
- failure "failed to stop cman"
- echo
- fi
-
- # need the extra echo to properlly terminate the line
- return $rtrn
+stop()
+{
+ echo -n "Stopping cluster: "
+ stop_fence
+ [ $? -ne 0 ] && return 1
+ stop_daemons
+ [ $? -ne 0 ] && return 1
+ if [ $1 ]; then
+ stop_cman $1
+ else
+ stop_cman
+ fi
+ [ $? -ne 0 ] && return 1
+ stop_ccsd
+ [ $? -ne 0 ] && return 1
+ stop_configfs
+ [ $? -ne 0 ] && return 1
+ return 0
}
rtrn=1
# See how we were called.
case "$1" in
- start)
+ start)
start
rtrn=$?
[ $rtrn = 0 ] && touch $LOCK_FILE
+ if [ $rtrn -ne 0 ]
+ then
+ echo $errmsg
+ failure "failed to start cman"
+ echo
+ else
+ success "start"
+ echo
+ fi
;;
-
- stop)
+ stop)
if [ $2 ]; then
- stop
+ stop
else
- stop remove
+ stop remove
fi
rtrn=$?
[ $rtrn = 0 ] && rm -f $LOCK_FILE
+ if [ $rtrn -ne 0 ]
+ then
+ echo $errmsg
+ failure "failed to stop cman"
+ echo
+ else
+ success "shutdown"
+ echo
+ fi
;;
- restart)
+ restart)
$0 stop restart
- $0 start
+ $0 start
rtrn=$?
;;
- status)
- cat /proc/cluster/status 2>/dev/null
+ status)
+ /sbin/cman_tool status 2>/dev/null
rtrn=$?
;;
- *)
- echo $"Usage: $0 {start|stop|restart|status}"
- ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ ;;
esac
exit $rtrn
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2008-01-18 16:47 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-30 13:20 [Cluster-devel] cluster/cman/init.d cman pcaulfield
-- strict thread matches above, loose matches on Subject: below --
2008-01-18 16:47 adas
2007-12-11 14:04 pcaulfield
2007-12-11 11:22 pcaulfield
2007-07-17 16:10 rmccabe
2007-07-12 19:50 rmccabe
2007-05-10 21:45 rmccabe
2007-05-10 14:45 rmccabe
2007-05-10 14:36 rmccabe
2007-04-27 22:08 cfeist
2007-04-27 15:07 rmccabe
2006-12-08 22:01 adas
2006-12-08 22:01 adas
2006-11-15 16:55 lhh
2006-11-15 16:55 lhh
2006-11-15 16:54 lhh
2006-10-18 21:48 rpeterso
2006-10-04 20:32 rpeterso
2006-08-31 18:00 rohara
2006-08-25 22:04 adas
2006-07-21 21:02 rpeterso
2006-07-20 20:19 rpeterso
2006-06-28 20:57 adas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).