Handle short name of OS status
The x86-power-control project uses short names for OS status in D-Bus,
for instance, "Inactive" instead of
"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive".
From now on, hostlogger flushes the logs when the system goes into an
Inactive or Standby state.
Resolves #1.
Change-Id: I2b178d4086e19a2cf15825cf3ad2529e7b053dcc
Signed-off-by: Artem Senichev <a.senichev@yadro.com>
diff --git a/src/service.cpp b/src/service.cpp
index eda8545..a5610e4 100644
--- a/src/service.cpp
+++ b/src/service.cpp
@@ -10,7 +10,14 @@
using namespace phosphor::logging;
// clang-format off
-/** @brief Host state properties. */
+/** @brief Host state monitor properties.
+ * Used for automatic flushing the log buffer to the persistent file.
+ * Contains a list of properties and a set of their values that trigger the
+ * flush operation.
+ * For example, the current log buffer will be saved to a file when the
+ * "OperatingSystemState" property obtains one of the
+ * listed values ("xyz.openbmc_project...BootComplete", "Inactive", etc).
+ */
static const DbusLoop::WatchProperties watchProperties{
{"xyz.openbmc_project.State.Host", {{
"RequestedHostTransition", {
@@ -18,7 +25,9 @@
{"xyz.openbmc_project.State.OperatingSystem.Status", {{
"OperatingSystemState", {
"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
- "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"}}}}
+ "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
+ "Inactive",
+ "Standby"}}}}
};
// clang-format on