Skip to content

Commit 8c1ded6

Browse files
authored
[SONiC-CEL]: fix platform fancontrol testcase failure issue (#10934)
1 parent 912923f commit 8c1ded6

File tree

1 file changed

+6
-2
lines changed
  • platform/broadcom/sonic-platform-modules-cel/services/fancontrol

1 file changed

+6
-2
lines changed

platform/broadcom/sonic-platform-modules-cel/services/fancontrol/fancontrol

+6-2
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,12 @@ CheckFiles || exit 1
348348

349349
if [ -f "$PIDFILE" ]
350350
then
351-
echo "File $PIDFILE exists, is fancontrol already running?" >&2
352-
exit 1
351+
# Test if process is really running, if not, no need to exit
352+
if ps -p $(echo $PIDFILE) > /dev/null
353+
then
354+
echo "File $PIDFILE exists, is fancontrol already running?" >&2
355+
exit 1
356+
fi
353357
fi
354358
echo $$ > "$PIDFILE"
355359

0 commit comments

Comments
 (0)