Don't apply restore policy if system is on

If the BMC was rebooted while the chassis power was on
then we want the BMC to update it's targets to reflect
this and leave the system as-is. This also applies if
the host is running.

Resolves openbmc/openbmc#2180

Change-Id: Ib9c067d79368db749fd65d050132d15ad793fdbf
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 a959311..f398038 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
@@ -7,6 +7,7 @@
 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
+ConditionPathExists=!/run/openbmc/chassis@%i-on
 
 [Service]
 Restart=no