control: Load config file(s) when available
Fan control's config file(s) are loaded when the fan control service
starts if found either in the override location, default location, or
the compatible interface is available. When the required config file(s)
are not found at startup, it waits to receive the interfacesAdded signal
that the compatible interface is available and then loads its config
file(s).
If at any point another interfacesAdded signal for the compatible
interface is received after successfully loading its config file(s),
this signal is ignored. So the only method to reload the config file(s)
is by providing the SIGHUP signal.
Change-Id: I14f93a684bb00a6a32f8cb228cbfb9ce3f022c92
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/main.cpp b/control/main.cpp
index 9c7f8a2..9284ae4 100644
--- a/control/main.cpp
+++ b/control/main.cpp
@@ -71,6 +71,10 @@
#ifdef CONTROL_USE_JSON
json::Manager manager(event);
+ // Handle loading fan control's config file(s)
+ phosphor::fan::JsonConfig config(
+ std::bind(&json::Manager::load, &manager));
+
// Enable SIGHUP handling to reload JSON configs
stdplus::signal::block(SIGHUP);
sdeventplus::source::Signal signal(