fix dependency issue between mpreboot and stop instr
During some testing of the mpreboot function, I noticed this journal
log:
Feb 04 17:12:05 bmc systemd[1]: op-stop-instructions@0.service: Found ordering cycle on op-enter-mpreboot@0.service/start
Feb 04 17:12:05 bmc systemd[1]: op-stop-instructions@0.service: Found dependency on obmc-host-stopped@0.target/start
Feb 04 17:12:05 bmc systemd[1]: op-stop-instructions@0.service: Found dependency on obmc-host-stopping@0.target/start
Feb 04 17:12:05 bmc systemd[1]: op-stop-instructions@0.service: Found dependency on op-stop-instructions@0.service/start
Feb 04 17:12:05 bmc systemd[1]: op-stop-instructions@0.service: Job obmc-host-stopped@0.target/start deleted to break ordering cycle starting with op-stop-instructions@0.service/start
The issue is that op-enter-mpreboot@.service says it has to run after
the host has been stopped, but before op-stop-instructions@.service.
This is because op-enter-mpreboot@.service creates the file which tells
op-stop-instructions@.service to not run. op-stop-instructions@.service
is what causes the host to stop, so we end up with a cyclical
dependency.
To fix this, just have op-enter-mpreboot@.service run during the same
target as op-stop-instructions@.service. The only service run here in
that window is op-stop-instructions@service anyway.
This was all a result of the request we not run
op-stop-instructions@.service in the mpreboot path.
Tested: Verified I no longer see the error messages above during a
mpreboot.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ied611bad3727a11a76aae48ff0a81c30a35952b2
diff --git a/op-enter-mpreboot@.service.in b/op-enter-mpreboot@.service.in
index 0455298..61860a3 100644
--- a/op-enter-mpreboot@.service.in
+++ b/op-enter-mpreboot@.service.in
@@ -1,7 +1,9 @@
[Unit]
Description=Start memory preserving reboot host%i
-Wants=obmc-host-stopped@%i.target
-After=obmc-host-stopped@%i.target
+Wants=obmc-host-stop-pre@%i.target
+After=obmc-host-stop-pre@%i.target
+Wants=obmc-host-stopping@%i.target
+Before=obmc-host-stopping@%i.target
Before=op-stop-instructions@%i.service
After=phosphor-reset-sensor-states@%i.service
Before=phosphor-reboot-host@%i.service