Ensure applications wait for reset services

When a BMC reboot occurs with the host running, need
to ensure the reset targets and services run before
we start other application that depend on whether
the host is running

Specifically, don't start phosphor-host-state-manager until
it's been determined if the host is up.  Don't start
phosphor-discover-system-state until the state of the
chassis is known.

Change-Id: I458fa78802cd9ecca99c54834512bfebf04b5012
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-discover-system-state@.service b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-discover-system-state@.service
index 7dc09d3..4e34396 100644
--- a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-discover-system-state@.service
+++ b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-discover-system-state@.service
@@ -6,6 +6,7 @@
 After=mapper-wait@-xyz-openbmc_project-state-host%i.service
 Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
 After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
+After=op-reset-chassis-on@%i.service
 
 [Service]
 Restart=no
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service b/meta-phosphor/common/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service
index 3b8551b..9adeed9 100644
--- a/meta-phosphor/common/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service
+++ b/meta-phosphor/common/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service
@@ -5,6 +5,7 @@
 Wants=mapper-wait@-org-openbmc-managers-System.service
 After=mapper-wait@-org-openbmc-managers-System.service
 Before=mapper-wait@-xyz-openbmc_project-state-host.service
+After=phosphor-reset-host-running@0.service
 
 [Service]
 ExecStart={sbindir}/phosphor-host-state-manager