All of lore.kernel.org
 help / color / mirror / Atom feed
From: rohara@sourceware.org <rohara@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/scsi scsi_reserve scsi_re ...
Date: 26 Jan 2007 20:03:53 -0000	[thread overview]
Message-ID: <20070126200353.3461.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	rohara at sourceware.org	2007-01-26 20:03:51

Modified files:
	fence/agents/scsi: scsi_reserve 
Added files:
	fence/agents/scsi: scsi_reserve.sysconfig scsi_watchdog 
	                   scsi_watchdog.conf 

Log message:
	Added support for watchdog "fencing".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/scsi_reserve.sysconfig.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/scsi_watchdog.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/scsi_watchdog.conf.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/scsi_reserve.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.6.9&r2=1.1.6.10

--- cluster/fence/agents/scsi/scsi_reserve	2007/01/26 17:56:14	1.1.6.9
+++ cluster/fence/agents/scsi/scsi_reserve	2007/01/26 20:03:51	1.1.6.10
@@ -5,6 +5,8 @@
 
 . /etc/init.d/functions
 
+[ -f /etc/sysconfig/scsi_reserve ] && . /etc/sysconfig/scsi_reserve
+
 # check for sg_persist command provided by sg3_utils package
 #
 if ! sg_persist -V &> /dev/null ; then
@@ -65,16 +67,16 @@
 
   if [ $error -eq 0 ]; then
       echo $dev >> /var/run/scsi_reserve
-      success
+      success "register of device $dev"
   else
       # perhaps we are already resgistered
       #
       if sg_persist -d $dev -i -k 2>/dev/null | grep -qiE "${key#0}" ; then
 	  echo $dev >> /var/run/scsi_reserve
-          success
+          success "register device $dev"
       else
           failure
-          rval=1
+	  rval=1
       fi
   fi
 
@@ -85,12 +87,37 @@
   sg_persist -d $dev -o -R -K $key -T 5 &>/dev/null
 
 done
+
+# start the watchdog if configured and registration was successful
+#
+if [ "$rval" == 0 ] && [ "${WATCHDOG}" == yes ] ; then
+    echo -n "Starting watchdog: "
+    if watchdog -c /etc/cluster/scsi_watchdog.conf ; then
+	success "watchdog start"
+    else
+	failure "watchdog start"
+    fi
+    echo
+fi
 ;;
 
 stop)
 
 rval=0
 
+# stop the watchdog before we unregister
+#
+if [ "${WATCHDOG}" == yes ]; then
+    echo -n "Stopping watchdog: "
+
+    if killproc watchdog ; then
+	success "watchdog stop"
+    else
+	failure "watchdog stop"
+    fi
+    echo
+fi
+
 # unregister each device for this node
 #
 for dev in $scsi_devices
@@ -122,7 +149,7 @@
   fi
 
   if [ $error -eq 0 ]; then
-      success
+      success "unregister device $dev"
   else
       failure
       rval=1



                 reply	other threads:[~2007-01-26 20:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070126200353.3461.qmail@sourceware.org \
    --to=rohara@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.