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