Add support for application startup events.
Allow clients to specify filters and actions that trigger
on application startup.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: Ib36c5bab778d7c87906dd3f61a3a6e033c7ccde1
diff --git a/manager.cpp b/manager.cpp
index 1ebcb7f..8026bf0 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -114,6 +114,22 @@
void Manager::run() noexcept
{
+ sdbusplus::message::message unusedMsg{nullptr};
+
+ // Run startup events.
+ for (auto& group : _events)
+ {
+ for (auto pEvent : std::get<std::vector<details::EventBasePtr>>(
+ group))
+ {
+ if (pEvent->type ==
+ details::Event::Type::STARTUP)
+ {
+ handleEvent(unusedMsg, *pEvent, group);
+ }
+ }
+ }
+
while (!_shutdown)
{
try