Skip to content

Commit

Permalink
Fix log_ssd_health hang issue (#1904)
Browse files Browse the repository at this point in the history
What I did
Fix sonic-net/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
  • Loading branch information
dgsudharsan authored Oct 29, 2021
1 parent ea4a730 commit 80a10dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/log_ssd_health
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 80a10dc

Please sign in to comment.