Install witherspoon fan watchdog service
This service will start on a power on and uses the busybox
watchdog app to continuously ping the watchdog device.
If other logic that is in place detects that phosphor-fan has
lost control of the fans, it will start the obmc-fan-watchdog-takeover
target, which will stop this service and expire the watchdog, pushing
the fans to high speed. A power cycle or BMC reboot is
required to recover fan control.
An environment file is used to give the watchdog app the device
and timeout parameters.
Change-Id: I7088d3ea97beaa4922b9ad357f0ce9738e10cb22
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-watchdog.bb b/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-watchdog.bb
index a74293f..1fdca17 100644
--- a/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-watchdog.bb
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/fans/witherspoon-fan-watchdog.bb
@@ -5,6 +5,7 @@
inherit obmc-phosphor-systemd
RDEPENDS_${PN} += "phosphor-gpio-monitor"
+RDEPENDS_${PN} += "busybox"
RESET_SERVICE = "witherspoon-reset-fan-watchdog.service"
TGTFMT = "obmc-chassis-poweron@0.target"
@@ -12,6 +13,10 @@
MONITOR_SERVICE = "witherspoon-fan-watchdog-monitor@.service"
-SYSTEMD_SERVICE_${PN} += "${RESET_SERVICE} ${MONITOR_SERVICE}"
-SYSTEMD_LINK_${PN} += "${RESET_FMT}"
-SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/witherspoon-fan-watchdog/witherspoon-reset-fan-watchdog.conf"
+WATCHDOG_SERVICE = "witherspoon-fan-watchdog.service"
+WATCHDOG_FMT = "../${WATCHDOG_SERVICE}:${TGTFMT}.requires/${WATCHDOG_SERVICE}"
+
+SYSTEMD_SERVICE_${PN} += "${RESET_SERVICE} ${MONITOR_SERVICE} ${WATCHDOG_SERVICE}"
+SYSTEMD_LINK_${PN} += "${RESET_FMT} ${WATCHDOG_FMT}"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/witherspoon-fan-watchdog/reset-fan-watchdog.conf"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/witherspoon-fan-watchdog/fan-watchdog.conf"