Handle InterfacesRemoved signal under /xyz/openbmc_project/sensor path
Listen for InterfacesRemoved signal and restart control loops. Without
this, the pid loop may run with staled sensor value if the corresponding
object or interface is removed.
Tested:
...
PID Zone 0 max SetPoint 16800 requested by ...
PID Zone 0 max SetPoint 16800 requested by ...
<- systemctl stop xyz.openbmc_project.nvmesensor here ->
New configuration detected, reloading
.1 Failed during restartControlLoops, try again: wait for count back to 1
Zone Zone 1 is at ZoneIndex 1
Zone Zone 0 is at ZoneIndex 0
Zone Zone 2 is at ZoneIndex 2
...
Change-Id: I900edda48b71dc7b6ae79a4b51f4088aea69183a
Signed-off-by: Jinliang Wang <jinliangw@google.com>
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 96d2b4b..f055c11 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -249,6 +249,10 @@
"type='signal',member='InterfacesAdded',arg0path='/xyz/openbmc_project/"
"sensors/'",
eventHandler, &timer);
+ matches.emplace_back(bus,
+ "type='signal',member='InterfacesRemoved',arg0path='/"
+ "xyz/openbmc_project/sensors/'",
+ eventHandler, &timer);
}
/**