commit | eb0e473f6e0486def495a35a1abb8a17b14200c5 | [log] [tgz] |
---|---|---|
author | Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> | Thu Apr 25 15:54:39 2024 +0800 |
committer | Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> | Mon Apr 29 16:45:46 2024 +0800 |
tree | 3cf8e0515e5c90cf8ab926028c0ac40b6f119f9f | |
parent | af3be559afac7073c762b5b00b7e46fbea1f42aa [diff] |
meta-facebook: Limit times waiting for MCTP connection It shouldn't keep waiting for MCTP connection if mctpd somehow crashed. Limit it to wait for only 1 minutes. Change-Id: I7b6d70a849c4f2a6be2d7bfcab49ba1b2e152807 Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-powercycle@.service b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-powercycle@.service index 34fcb2a..eb11752 100644 --- a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-powercycle@.service +++ b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-powercycle@.service
@@ -4,8 +4,7 @@ [Service] Type=oneshot ExecStart=/usr/libexec/phosphor-state-manager/chassis-powercycle %i -ExecStartPost=/usr/libexec/phosphor-state-manager/wait-until-mctp-connection-done %i -ExecStartPost=/bin/systemctl restart phosphor-discover-system-state@%i.service +ExecStartPost=/bin/bash -c "/usr/libexec/phosphor-state-manager/wait-until-mctp-connection-done %i && systemctl restart phosphor-discover-system-state@%i.service" [Install] WantedBy=obmc-chassis-powercycle@%i.target
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-poweron@.service b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-poweron@.service index 86f8e7e..2345ecf 100644 --- a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-poweron@.service +++ b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/chassis-poweron@.service
@@ -4,8 +4,7 @@ [Service] Type=oneshot ExecStart=/usr/libexec/phosphor-state-manager/chassis-poweron %i -ExecStartPost=/usr/libexec/phosphor-state-manager/wait-until-mctp-connection-done %i -ExecStartPost=/bin/systemctl restart phosphor-discover-system-state@%i.service +ExecStartPost=/bin/bash -c "/usr/libexec/phosphor-state-manager/wait-until-mctp-connection-done %i && systemctl restart phosphor-discover-system-state@%i.service" [Install] WantedBy=obmc-chassis-poweron@%i.target
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/wait-until-mctp-connection-done b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/wait-until-mctp-connection-done index 9273851..569f47f 100644 --- a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/wait-until-mctp-connection-done +++ b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/wait-until-mctp-connection-done
@@ -1,13 +1,18 @@ #!/bin/bash EID=$(($1*10)) +count=0 -while true; do +while [ $count -lt 12 ]; do busctl get-property xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp/1/"$EID" xyz.openbmc_project.MCTP.Endpoint EID isMctpConnect=$?; echo $isMctpConnect if [ $isMctpConnect -eq 0 ]; then - break; + exit 0; fi sleep 5; + count=$((count + 1)) done + +echo "timeout waiting for MCTP connection" +exit 1