meta-phosphor: PSM: correct dependences of multi-user.target
Issue: When users request to turn off the host,
phosphor-bmc-state-manager sets BMC's state to "Ready" one more time.
Root cause: When BMC turns off the host, obmc-host-reset@.target is
stopped. The multi-user.target is requiring obmc-host-reset@.target,
therefore, it has been stopped even it has been reached before. The
phosphor-bmc-state-manager is monitoring the multi-user.target signal,
it detects that multi-user.target is done, therefore it sets BMC's state
to "Ready" again.
Solution: As defined in phosphor-state-manager [1], the
obmc-host-reset@.target is wanted by multi-user.target, but in the [2],
the multi-user.target is requiring obmc-host-reset@.target. This commit
corrects the dependences of multi-user.target from requires to wants for
obmc-host-reset@.target.
[1]https://github.com/openbmc/phosphor-state-manager/blob/master/target_files/obmc-host-reset%40.target#L6
[2]https://github.com/openbmc/openbmc/blob/eaff5a8909e88daab9c83089da8ef61ffa578c06/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc#L2
Tested:
1. Turn on then turn off the host.
2. Check the phosphor-bmc-state-manager logs.
$journalctl | grep phosphor-bmc-state-manager
3. phosphor-bmc-state-manager only sets BMC's state to "Ready"
one time.
Fixes: 20cff7042b7ea3c670bfa3783dfd1dba54531226
Change-Id: I67a6007c36a885d64bdc217df1c334c7293f94a7
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
index f6fa3c4..e0abd46 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
@@ -1,5 +1,5 @@
HOST_DEFAULT_TARGETS = " \
- multi-user.target.requires/obmc-host-reset@{}.target \
+ multi-user.target.wants/obmc-host-reset@{}.target \
multi-user.target.wants/phosphor-discover-system-state@{}.service \
obmc-host-start@{}.target.requires/obmc-host-startmin@{}.target \
obmc-host-start@{}.target.requires/phosphor-reset-host-reboot-attempts@{}.service \