Implement a flag to enable fallback always
On some machines we want our watchdog running as long as the
phosphor-watchdog daemon is alive. This patch adds an option to enter
fallback mode any time the watchdog expires or is set to be disabled.
Change-Id: Ic96d2f15c761aeb4e25158c5bd861076cca6497d
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/argument.cpp b/argument.cpp
index c2d99ce..770db87 100644
--- a/argument.cpp
+++ b/argument.cpp
@@ -28,7 +28,7 @@
const std::vector<std::string> emptyArg;
const std::string ArgumentParser::trueString = "true"s;
-const char* ArgumentParser::optionStr = "p:s:t:a:f:i:ch";
+const char* ArgumentParser::optionStr = "p:s:t:a:f:i:ech";
const option ArgumentParser::options[] =
{
{ "path", required_argument, nullptr, 'p' },
@@ -37,6 +37,7 @@
{ "action_target", required_argument, nullptr, 'a' },
{ "fallback_action", required_argument, nullptr, 'f' },
{ "fallback_interval", required_argument, nullptr, 'i' },
+ { "fallback_always", no_argument, nullptr, 'e' },
{ "continue", no_argument, nullptr, 'c' },
{ "help", no_argument, nullptr, 'h' },
{ 0, 0, 0, 0},
@@ -111,6 +112,9 @@
"watchdog even when disabled via the dbus interface. "
"Waits for this interval before performing the fallback "
"action.\n";
+ std::cerr << " [--fallback_always] Enables the "
+ "watchdog even when disabled by the dbus interface. "
+ "This option is only valid with a fallback specified.\n";
std::cerr << " [--continue] Continue daemon "
"after watchdog timeout.\n";
}