Do not run chassis power target services if power on
This is the first commit in a series that will ensure
we do not run the chassis power on services when the
chassis is already on.
Specifically this is to handle the situation where the
chassis is on and the BMC is rebooted.
Change-Id: I733ca076f044731a4ba327fe2f46302dce5f4edd
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service
index e759d5d..c9cd09a 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service
@@ -7,6 +7,7 @@
Wants=fsi-scan@%i.service
After=fsi-scan@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/vcs_workaround.sh {MACHINE}
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
index 55957f3..4d300c5 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
@@ -4,6 +4,7 @@
After=avsbus-workaround@%i.service
Before=vrm-control@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/avsbus-disable.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
index 850da21..34e68fe 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
@@ -3,6 +3,7 @@
Wants=vrm-control@%i.service
After=vrm-control@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/avsbus-enable.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service
index ea18e16..1bae8df 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service
@@ -4,6 +4,7 @@
After=op-power-start@.service
Before=avsbus-disable@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/avsbus-workaround.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
index 55957f3..4d300c5 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
@@ -4,6 +4,7 @@
After=avsbus-workaround@%i.service
Before=vrm-control@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/avsbus-disable.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
index e7d3fe1..3547567 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
@@ -4,6 +4,7 @@
After=vrm-control@%i.service
Before=vcs_off@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/avsbus-enable.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service
index ac1c6c0..b3eb1b8 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/avsbus-control/avsbus-workaround@.service
@@ -4,6 +4,7 @@
After=ucd_disable_vcs@%i.service
Before=avsbus-disable@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/avsbus-workaround.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs@.service
index cf2fdce..1608894 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs@.service
@@ -3,6 +3,7 @@
Wants=obmc-power-start-pre@%i.target
Before=obmc-power-start-pre@%i.target
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/ucd_disable_vcs.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off@.service
index f929afb..81cc681 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off@.service
@@ -3,6 +3,7 @@
Wants=obmc-power-start-pre@%i.target
Before=obmc-power-start-pre@%i.target
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/vcs_off.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on@.service
index df74920..181026c 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on@.service
@@ -5,6 +5,7 @@
Wants=obmc-host-start-pre@%i.target
Before=obmc-host-start-pre@%i.target
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/vcs_on.sh
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/vrm-control@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/vrm-control@.service
index 607423a..12c189f 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/vrm-control@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/vrm-control@.service
@@ -4,6 +4,7 @@
After=avsbus-disable@%i.service
Before=avsbus-enable@%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/vrm-control.sh vdna=0.9 vdnb=0.9
diff --git a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
index f9fd425..8561bf2 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-disable@.service
@@ -3,6 +3,7 @@
Wants=obmc-power-stop-pre@%i.target
Before=obmc-power-stop-pre@%i.target
Conflicts=obmc-chassis-start@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/zaius_avsbus.sh disable
diff --git a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
index 5980d7c..f305907 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
+++ b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
@@ -3,6 +3,7 @@
Wants=obmc-host-start-pre@%i.target
Before=obmc-host-start-pre@%i.target
Conflicts=obmc-chassis-stop@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart={bindir}/zaius_avsbus.sh vdn_max
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service
index 8f94e28..ca19f1d 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service
@@ -5,6 +5,7 @@
Wants=obmc-host-start-pre@%i.target
Before=obmc-host-start-pre@%i.target
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
ExecStart=/bin/sh -c "echo 1 > /sys/bus/platform/devices/fsi-master/scan"
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service
index d6c1ae4..0813123 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service
@@ -7,6 +7,7 @@
Wants=mapper-wait@-org-openbmc-control-power%i.service
After=mapper-wait@-org-openbmc-control-power%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
RemainAfterExit=yes
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service
index d5eb9dc..5245846 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service
@@ -6,6 +6,7 @@
Wants=mapper-wait@-org-openbmc-control-power%i.service
After=mapper-wait@-org-openbmc-control-power%i.service
Conflicts=obmc-power-chassis-off@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
Type=oneshot