Add support to mask and unmask host crash target
When the host crashes, BMC gets to know about that and causes a
transition to Quiesce state as part of executing a target.
Doing so, makes the system move out of fail state.
This patch set masks and unmasks the target on recoveryoff
and recoveryon respectively
Tested:
:/tmp# ./obmcutil recoveryoff
Created symlink /etc/systemd/system/obmc-host-timeout@0.target → /dev/null.
Created symlink /etc/systemd/system/obmc-host-crash@0.target → /dev/null.
:/tmp# ./obmcutil recoveryon
Removed /etc/systemd/system/obmc-host-timeout@0.target.
Removed /etc/systemd/system/obmc-host-crash@0.target.
Change-Id: I49dff827b78a6fc2a35d2dd0d79b5c05c20eb39b
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/obmcutil b/obmcutil
index 64945b6..703c129 100755
--- a/obmcutil
+++ b/obmcutil
@@ -17,6 +17,7 @@
CONTROL_OBJECT=$OBJECT_ROOT/control
HOST_TIMEOUT_TARGET=obmc-host-timeout@0.target
+HOST_CRASH_TARGET=obmc-host-crash@0.target
## NOTE: The following global variables are used only in the run_timeout cmd.
## By declaring these globally instead of passing them through the
@@ -49,10 +50,10 @@
echo "obmcutil rebootoff Disable auto reboot from Quiesce state"
echo "obmcutil rebooton Enable auto reboot from Quiesce state"
echo ""
- echo "obmcutil recoveryoff Disable boot watchdog timeout handling and"
- echo " disable auto reboot from Quiesce state"
- echo "obmcutil recoveryon Enable boot watchdog timeout handling and"
- echo " enable auto reboot from Quiesce state"
+ echo "obmcutil recoveryoff Disable handling boot watchdog timeout and host crash"
+ echo " Also, disable auto reboot from Quiesce state"
+ echo "obmcutil recoveryon Enable handling boot watchdog timeout and host crash"
+ echo " Also, enable auto reboot from Quiesce state"
echo ""
echo "optional arguments:"
echo " -h, --help show this help message and exit"
@@ -272,10 +273,12 @@
recoveryoff)
handle_cmd rebootoff
mask_systemd_target $HOST_TIMEOUT_TARGET
+ mask_systemd_target $HOST_CRASH_TARGET
;;
recoveryon)
handle_cmd rebooton
unmask_systemd_target $HOST_TIMEOUT_TARGET
+ unmask_systemd_target $HOST_CRASH_TARGET
;;
*)
print_usage_err "Invalid command '$1'"