From 80a10dcb99fd96b443bf403b947e6acc95835b9a Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Fri, 29 Oct 2021 12:19:11 -0700 Subject: [PATCH] Fix log_ssd_health hang issue (#1904) What I did Fix Azure/sonic-buildimage#9114 The log_ssd_health command hangs due to timeout being used with docker exec -i which also affect warmboot flow. How I did it Added foreground option for timeout. This is recommended when not using the command on shell https://man7.org/linux/man-pages/man1/timeout.1.html How to verify it Run log_ssd_health and verify it does not hang Signed-off-by: Sudharsan Dhamal Gopalarathnam sudharsand@nvidia.com --- scripts/log_ssd_health | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/log_ssd_health b/scripts/log_ssd_health index d0e1f4a4b8..3f9d6b2267 100755 --- a/scripts/log_ssd_health +++ b/scripts/log_ssd_health @@ -1,6 +1,6 @@ #! /bin/bash -timeout 30 smartctl -a /dev/sda > /tmp/smartctl +timeout --foreground 30 smartctl -a /dev/sda > /tmp/smartctl if [ -f /tmp/smartctl ];then logger -f /tmp/smartctl fi