clear host-on file when host stopped
This file is currently removed in the chassis poweroff target within the
op-wait-power-off service. This was fine until our recent introduction of
warm resets.
Here's the scenario that causes trouble:
- Reboot BMC with host up, /run/openbmc/host@0-on is created to indicate
the host is already on and the services involved in booting the host
should do nothing.
- Now issue a warm reboot of the host. Because the chassis power is not
cycled on a warm reboot, the service is not run which clears the
host@0-on file. This then leads to the service responsible for starting
the host not running.
The solution is to clear this file when the host is stopped.
The removal of the file should stay within chassis poweroff target to
handle corner cases where only a hard power off is done to the system.
Tested:
Built image with fix and verified that test scenario now works and that
file was cleared as expected as a part of the warm reboot.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I6383d96f7a6be32ca19b998d9cd1cce81a307412
diff --git a/op-stop-instructions@.service.in b/op-stop-instructions@.service.in
index 38a3e7e..e13a606 100644
--- a/op-stop-instructions@.service.in
+++ b/op-stop-instructions@.service.in
@@ -12,6 +12,7 @@
Type=oneshot
# TODO - Replace with official istep stopinstructions once available
ExecStart=/usr/bin/pdbg -a stop
+ExecStart=/bin/rm -f /run/openbmc/host@%i-on
[Install]
WantedBy=obmc-host-stop@%i.target