Fix bug with pcie-check.service (#5368)
* Change STATE_DB key (PCIE_STATUS|PCIE_DEVICES -> PCIE_DEVICES) Signed-off-by: Petro Bratash <petrox.bratash@intel.com> * [pcie-check.service] Add dependency on database.service Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
This commit is contained in:
parent
da3579cf36
commit
558ec53aa6
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Check the PCIe device presence and status
|
Description=Check the PCIe device presence and status
|
||||||
After=rc.local.service
|
After=rc.local.service database.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
@ -16,7 +16,7 @@ function debug()
|
|||||||
|
|
||||||
function check_and_rescan_pcie_devices()
|
function check_and_rescan_pcie_devices()
|
||||||
{
|
{
|
||||||
PCIE_CHK_CMD=$(sudo pcieutil pcie-check |grep "$RESULTS")
|
PCIE_CHK_CMD='sudo pcieutil pcie-check |grep "$RESULTS"'
|
||||||
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
|
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
|
||||||
|
|
||||||
if [ ! -f /usr/share/sonic/device/$PLATFORM/plugins/pcie.yaml ]; then
|
if [ ! -f /usr/share/sonic/device/$PLATFORM/plugins/pcie.yaml ]; then
|
||||||
@ -36,8 +36,8 @@ function check_and_rescan_pcie_devices()
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PCIE_CHK_CMD" = "$EXPECTED" ]; then
|
if [ "$(eval $PCIE_CHK_CMD)" = "$EXPECTED" ]; then
|
||||||
redis-cli -n 6 SET "PCIE_STATUS|PCIE_DEVICES" "PASSED"
|
redis-cli -n 6 HSET "PCIE_DEVICES" "status" "PASSED"
|
||||||
debug "PCIe check passed"
|
debug "PCIe check passed"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
@ -53,7 +53,7 @@ function check_and_rescan_pcie_devices()
|
|||||||
|
|
||||||
done
|
done
|
||||||
debug "PCIe check failed"
|
debug "PCIe check failed"
|
||||||
redis-cli -n 6 SET "PCIE_STATUS|PCIE_DEVICES" "FAILED"
|
redis-cli -n 6 HSET "PCIE_DEVICES" "status" "FAILED"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_and_rescan_pcie_devices
|
check_and_rescan_pcie_devices
|
||||||
|
Reference in New Issue
Block a user