phosphor-watchdog: Send Signal None for timout
As per IPMI specification signal should be send
for action "None" when no timout action
configured. Because TimerExpired also a event.
00h - Timer expired
01h - Hard reset
02h - Power down
03h - Power cycle
Tested:
Successfully build and tested in reference
platform.
Signal received when action configured as None.
Signed-off-by: selvaganapathi <selvaganapathim@ami.com>
Change-Id: I9a0ee11c31a6dc3992f0b6689753b468cf78a095
diff --git a/src/watchdog.cpp b/src/watchdog.cpp
index 918a372..eda2d7f 100644
--- a/src/watchdog.cpp
+++ b/src/watchdog.cpp
@@ -133,19 +133,6 @@
try
{
- auto signal = bus.new_signal(
- objPath.data(), "xyz.openbmc_project.Watchdog", "Timeout");
- signal.append(convertForMessage(action).c_str());
- signal.signal_send();
- }
- catch (const sdbusplus::exception_t& e)
- {
- log<level::ERR>("watchdog: failed to send timeout signal",
- entry("ERROR=%s", e.what()));
- }
-
- try
- {
auto method = bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_ROOT,
SYSTEMD_INTERFACE, "StartUnit");
method.append(target->second);
@@ -161,6 +148,18 @@
commit<InternalFailure>();
}
}
+ try
+ {
+ auto signal = bus.new_signal(objPath.data(),
+ "xyz.openbmc_project.Watchdog", "Timeout");
+ signal.append(convertForMessage(action).c_str());
+ signal.signal_send();
+ }
+ catch (const sdbusplus::exception_t& e)
+ {
+ log<level::ERR>("watchdog: failed to send timeout signal",
+ entry("ERROR=%s", e.what()));
+ }
tryFallbackOrDisable();
}