Blame SOURCES/bz1265426-4-fence_scsi_hard.patch
|
|
e4ffb1 |
From 463e5bcc58e7c9d49033d0427bdcbc263cf98165 Mon Sep 17 00:00:00 2001
|
|
|
e4ffb1 |
From: Marek 'marx' Grac <mgrac@redhat.com>
|
|
|
e4ffb1 |
Date: Wed, 16 Dec 2015 13:46:23 +0100
|
|
|
e4ffb1 |
Subject: [PATCH 4/4] fence_scsi: Replace hard reboot with direct call to libc
|
|
|
e4ffb1 |
|
|
|
e4ffb1 |
---
|
|
|
e4ffb1 |
fence/agents/scsi/fence_scsi.py | 4 +++-
|
|
|
e4ffb1 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
e4ffb1 |
|
|
|
e4ffb1 |
diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py
|
|
|
e4ffb1 |
index c13d4ed..11eab73 100644
|
|
|
e4ffb1 |
--- a/fence/agents/scsi/fence_scsi.py
|
|
|
e4ffb1 |
+++ b/fence/agents/scsi/fence_scsi.py
|
|
|
e4ffb1 |
@@ -8,6 +8,7 @@ import time
|
|
|
e4ffb1 |
import logging
|
|
|
e4ffb1 |
import atexit
|
|
|
e4ffb1 |
import hashlib
|
|
|
e4ffb1 |
+import ctypes
|
|
|
e4ffb1 |
sys.path.append("@FENCEAGENTSLIBDIR@")
|
|
|
e4ffb1 |
from fencing import fail_usage, run_command, atexit_handler, check_input, process_input, show_docs, fence_action, all_opt
|
|
|
e4ffb1 |
from fencing import run_delay
|
|
|
e4ffb1 |
@@ -405,7 +406,8 @@ def scsi_check(hardreboot=False):
|
|
|
e4ffb1 |
logging.debug("key " + key + " registered with any devices")
|
|
|
e4ffb1 |
|
|
|
e4ffb1 |
if hardreboot == True:
|
|
|
e4ffb1 |
- os.system("reboot -f")
|
|
|
e4ffb1 |
+ libc = ctypes.cdll['libc.so.6']
|
|
|
e4ffb1 |
+ libc.reboot(0x1234567)
|
|
|
e4ffb1 |
return 2
|
|
|
e4ffb1 |
|
|
|
e4ffb1 |
|
|
|
e4ffb1 |
--
|
|
|
e4ffb1 |
2.4.3
|
|
|
e4ffb1 |
|