[Ocfs2-tools-commits] jlbec commits r519 - trunk/vendor/common
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Dec 29 12:41:25 CST 2004
Author: jlbec
Date: 2004-12-29 12:41:23 -0600 (Wed, 29 Dec 2004)
New Revision: 519
Modified:
trunk/vendor/common/o2cb.init
Log:
o Can now start this node, if o2cb_ctl is in the path.
Modified: trunk/vendor/common/o2cb.init
===================================================================
--- trunk/vendor/common/o2cb.init 2004-12-29 18:10:30 UTC (rev 518)
+++ trunk/vendor/common/o2cb.init 2004-12-29 18:41:23 UTC (rev 519)
@@ -55,6 +55,7 @@
if_fail()
{
RC="$1"
+ REASON="$2"
if [ "$RC" = "0" ]
then
echo "OK"
@@ -64,6 +65,10 @@
return
fi
echo "Failed"
+ if [ -n "${REASON}" ]
+ then
+ echo "${REASON}" >&2
+ fi
exit 1
}
@@ -252,7 +257,7 @@
}
-start()
+load()
{
for MODSPEC in $MODULE_LIST
do
@@ -271,8 +276,23 @@
done
}
-stop()
+online()
{
+ CLUSTER="$1"
+
+ #
+ # FIXME FIXME FIXME
+ # Right now, there is no way to check if we're already online.
+ # So this will always fail the second time around. Ugh.
+ #
+
+ echo -n "Starting cluster ${CLUSTER}: "
+ OUTPUT="$(o2cb_ctl -H -l "${O2CB_MANAGER}" -n "${CLUSTER}" -t cluster -a online=yes 2>&1)"
+ if_fail "$?" "$OUTPUT"
+}
+
+unload()
+{
# Reverse list for unloading
R_MODLIST=""
for MODSPEC in $MODULE_LIST
@@ -351,7 +371,11 @@
case "$1" in
start)
- start
+ load
+ if [ -n "$2" ]
+ then
+ online "$2"
+ fi
;;
status)
@@ -359,7 +383,7 @@
;;
stop)
- stop
+ unload
;;
restart)
@@ -367,8 +391,23 @@
start
;;
+ load)
+ load
+ ;;
+
+ online)
+ #
+ # FIXME: Cluster argument should perhaps be optional, with
+ # the default being all clusters configured.
+ #
+ online "$2"
+ ;;
+
+ unload)
+ unload
+ ;;
*)
- echo "Usage: $0 {start|stop|restart|enable|disable|status}"
+ echo "Usage: $0 {start|stop|restart|enable|disable|load|unload|status}"
exit 1
;;
esac
More information about the Ocfs2-tools-commits
mailing list