ensure reboot service runs after host stopped
OpenBMC has two types of targets, action and synchronization.
obmc-host-stop is an action target. You put services in it that you want
run when the target is started. obmc-host-stopped is a synchronization
target. You use it to ensure your service runs at the correct time. As a
part of the warm-reboot work, it was found that in certain conditions
this reboot service would run before the host was fully stopped due to
the way the obmc-host-stop action target is setup. Add the
synchronization target Wants/After in here to ensure this service is
only run after the host is stopped.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Id19034adc6309d20e94736948ae70d9cd6044263
diff --git a/service_files/phosphor-reboot-host@.service b/service_files/phosphor-reboot-host@.service
index f32bf22..0dd8bbb 100644
--- a/service_files/phosphor-reboot-host@.service
+++ b/service_files/phosphor-reboot-host@.service
@@ -2,6 +2,8 @@
Description=Reboot host%i
Wants=obmc-host-stop@%i.target
After=obmc-host-stop@%i.target
+Wants=obmc-host-stopped@%i.target
+After=obmc-host-stopped@%i.target
[Service]
#ExecStart=/bin/systemctl start obmc-host-start@%i.target