Reset boot progress and OS status sensors after reboot

Reset boot progress and OS status sensors if host is not
running

Resolves openbmc/openbmc#2804

Change-Id: I1fee2bf7776ae957e87452d9cfa7a4fca647b46f
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/common/recipes-phosphor/state/files/phosphor-reset-sensor-states@.service b/common/recipes-phosphor/state/files/phosphor-reset-sensor-states@.service
new file mode 100644
index 0000000..689372f
--- /dev/null
+++ b/common/recipes-phosphor/state/files/phosphor-reset-sensor-states@.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Reset host sensors
+After=phosphor-reset-host-check@%i.service
+Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service
+After=mapper-wait@-xyz-openbmc_project-state-host%i.service
+ConditionPathExists=!/run/openbmc/host@%i-on
+
+[Service]
+Restart=no
+Type=oneshot
+ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host0` /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Boot.Progress  BootProgress s xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified"
+ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host0` /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.OperatingSystem.Status OperatingSystemState s xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"
+
+[Install]
+WantedBy=obmc-host-reset@%i.target