fence-agents: RHEL6 - fence_scsi: Possibility for hard reboot when fence_scsi_check fails

Marek GrĂ¡c marx at fedoraproject.org
Thu Jun 26 13:24:18 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=917ed4bc76235d50ce36393817e6119e9065b2ef
Commit:        917ed4bc76235d50ce36393817e6119e9065b2ef
Parent:        3d471cad9d71706f938a177661a97fc3eed7237a
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Mon Jun 23 14:07:38 2014 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Mon Jun 23 14:07:38 2014 +0200

fence_scsi: Possibility for hard reboot when fence_scsi_check fails

Resolves: rhbz#1050022
---
 fence/agents/scsi/Makefile.am         |    7 +++++--
 fence/agents/scsi/fence_scsi_check.pl |    4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fence/agents/scsi/Makefile.am b/fence/agents/scsi/Makefile.am
index 5652bda..32f6549 100644
--- a/fence/agents/scsi/Makefile.am
+++ b/fence/agents/scsi/Makefile.am
@@ -5,11 +5,11 @@ TARGET			= fence_scsi
 SRC			= $(TARGET).pl
 
 EXTRA_DIST		= $(SRC) \
-			  $(TARGET)_check.pl 
+			  $(TARGET)_check.pl $(TARGET)_check_hardreboot.pl
 
 scsidatadir		= $(CLUSTERDATA)
 
-scsidata_SCRIPTS	= $(TARGET)_check.pl
+scsidata_SCRIPTS	= $(TARGET)_check.pl $(TARGET)_check_hardreboot.pl
 
 sbin_SCRIPTS		= $(TARGET)
 
@@ -19,3 +19,6 @@ include $(top_srcdir)/make/fencebuild.mk
 
 clean-local:
 	rm -f $(TARGET)
+
+fence_scsi_check_hardreboot.pl: fence_scsi_check.pl
+	cp fence_scsi_check.pl fence_scsi_check_hardreboot.pl
diff --git a/fence/agents/scsi/fence_scsi_check.pl b/fence/agents/scsi/fence_scsi_check.pl
index 9ecd7a5..a08c416 100644
--- a/fence/agents/scsi/fence_scsi_check.pl
+++ b/fence/agents/scsi/fence_scsi_check.pl
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 use POSIX;
+require 'syscall.ph';
 
 ################################################################################
 
@@ -128,6 +129,9 @@ sub dev_read ()
 ################################################################################
 
 if ($ARGV[0] =~ /^repair$/i) {
+    if ($0 =~ /hardreboot/) {
+        syscall(&SYS_reboot, 0xfee1dead, 672274793, 0x01234567);
+    }
     exit ($ARGV[1]);
 }
 


More information about the cluster-commits mailing list