phosphor: ensure host state sensors cleared on host stop

With some of the new targets like obmc-host-diagnostic-mode, the BMC can
be a while in these targets before other ones are started which start
initializing these sensors again. Need to be sure to reset them to
defaults once the host is stopped for any reason. This ensures that
other BMC software which is looking at these to know host boot state
have the correct information.

Tested:
- Verified sensors were reset when starting obmc-host-diagnostic-mode
target

(From meta-phosphor rev: 6f640bd9fcabae0affc0883940e47bdd5a13e752)

Change-Id: Iee12327b769ffed03dabb050fd4eed8137f76fe0
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
index c6ec8ea..4803cac 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
@@ -31,6 +31,11 @@
     TARGET="../phosphor-reset-host-running@.service"
     ln -s $TARGET $LINK
 
+    mkdir -p $D$systemd_system_unitdir/obmc-host-stop@0.target.wants
+    LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/phosphor-reset-sensor-states@0.service"
+    TARGET="../phosphor-reset-sensor-states@.service"
+    ln -s $TARGET $LINK
+
     mkdir -p $D$systemd_system_unitdir/obmc-host-shutdown@0.target.requires
     LINK="$D$systemd_system_unitdir/obmc-host-shutdown@0.target.requires/obmc-chassis-poweroff@0.target"
     TARGET="../obmc-chassis-poweroff@.target"
@@ -89,6 +94,9 @@
     LINK="$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/phosphor-reset-sensor-states@0.service"
     rm $LINK
 
+    LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/phosphor-reset-sensor-states@0.service"
+    rm $LINK
+
     LINK="$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/phosphor-reset-host-running@0.service"
     rm $LINK