summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-phosphor/chassis
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2018-01-10 18:16:28 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-03-01 17:19:14 +0300
commit253a5aa905bf3298817377d199becec9755cebf8 (patch)
tree0dae65be828864b06425d01e1e4d3817846f5d39 /meta-phosphor/common/recipes-phosphor/chassis
parenta304468028c34ef846130679b09b8e99f0e61761 (diff)
downloadopenbmc-253a5aa905bf3298817377d199becec9755cebf8.tar.xz
Keep fan services running until poweroff completes
All the fan services associated with controlling, monitoring and presence detection of fans need to remain active until a poweroff completes. This helps ensure thermal safety while a system is in transition to a powered off state. With the introduction of this new target (which runs last in the power off path), need to move the host reset service to running after it to ensure the power on in the reboot path does not start until the last power off target runs. Resolves openbmc/openbmc#2762 Change-Id: I4ca671d2c7de66e8bfa4bba607b06c88c0a6e7f9 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/chassis')
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb6
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service20
2 files changed, 26 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb
index 5dd6d12cf8..e341463b53 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb
@@ -20,6 +20,7 @@ SYSTEMD_SERVICE_${PN} += " \
op-wait-power-off@.service \
op-reset-chassis-running@.service \
op-reset-chassis-on@.service \
+ op-powered-off@.service \
"
SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control"
@@ -34,6 +35,10 @@ STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target"
STOP_INSTFMT = "op-power-stop@{0}.service"
STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}"
+POWERED_OFF_TMPL = "op-powered-off@.service"
+POWERED_OFF_INSTFMT = "op-powered-off@{0}.service"
+POWERED_OFF_FMT = "../${POWERED_OFF_TMPL}:${STOP_TGTFMT}.requires/${POWERED_OFF_INSTFMT}"
+
ON_TMPL = "op-wait-power-on@.service"
ON_INSTFMT = "op-wait-power-on@{0}.service"
ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}"
@@ -55,6 +60,7 @@ RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${R
# Build up requires relationship for START_TGTFMT and STOP_TGTFMT
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'POWERED_OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service
new file mode 100644
index 0000000000..b76db7bf41
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Power is off to chassis%i
+After=op-wait-power-off@%i.service
+Requires=op-wait-power-off@%i.service
+
+[Service]
+RemainAfterExit=no
+# systemd starts all wanted targets in parallel and a Conflict
+# statement will resolve itself when the target starts, not when
+# completes. Some services have a requirement to stop
+# once power is off. The solution is to create a new target,
+# obmc-chassis-powered-off@.target, that is started after it is
+# verified that power has been removed from the chassis. Then
+# services may conflict with this target to ensure they
+# are stopped at the appropriate time.
+ExecStart=/bin/systemctl start obmc-chassis-powered-off@%i.target
+
+
+[Install]
+WantedBy=obmc-chassis-poweroff@%i.target