add timeout to stop-instructions service
Stopping instructions on POWER based systems is a fairly complicated
process with a lot of moving parts. If one of these moving parts gets
hung up, the entire power off process gets hung up. This issue has been
seen intermittently over the years on different systems so for safety,
lets put a timeout in the service.
Stopping instructions is not a requirement to power off, it's just a
nice-to-have type function. Don't let it hanging prevent the overall
powering off of the system.
Note that this commit also moves the rm of the host@%i-on file to being
first. This is to ensure it always runs, even if the pdbg command times
out and causes the service to fail.
Tested:
- Verified on good path stop instructions takes 2-4 seconds.
- Verified when I caused this service to hang, we hit timeout and
powered off system.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I7d249051634aeca399e2ecf6d24bca5e19637160
diff --git a/op-stop-instructions@.service.in b/op-stop-instructions@.service.in
index 160a8bb..b068fac 100644
--- a/op-stop-instructions@.service.in
+++ b/op-stop-instructions@.service.in
@@ -12,9 +12,10 @@
[Service]
RemainAfterExit=yes
Type=oneshot
+TimeoutStartSec=10
+ExecStart=/bin/rm -f /run/openbmc/host@%i-on
# 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