Skip to content

Commit b3d5d18

Browse files
mlok-nokiayxieca
authored andcommitted
[MultiAsic] sudo reboot command doesn't gracefully stop Asic syncd# on multiasic platform (#2258)
What I did Function stop_sonic_service() in /usr/local/bin/reboot script doesn't handle stopping the Asic syncd# on multiasic platform. Instead, it only stops the syncd on non-multiasic platform. When issue command "sudo reboot", the below message will be shown. admin@sonic:~$ sudo reboot Error: No such container: syncd Fixes sonic-net/sonic-buildimage#11377 How I did it Add code the stop_sonic_services() to check and get NUM_ASIC. If it is multiasic, looping all asics and call the syncd_request_shutdown for each asic. How to verify it Issue the "sudo reboot" on the multiasic platform, the error message "Error: No such container: syncd" should not be shown.
1 parent 504ebe6 commit b3d5d18

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

scripts/reboot

+15-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,21 @@ function stop_sonic_services()
7272
fi
7373

7474
if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then
75-
debug "Stopping syncd process..."
76-
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null
75+
ASIC_CONF=${DEVPATH}/$PLATFORM/asic.conf
76+
if [ -f "$ASIC_CONF" ]; then
77+
source $ASIC_CONF
78+
fi
79+
if [[ ($NUM_ASIC -gt 1) ]]; then
80+
asic_num=0
81+
while [[ ($asic_num -lt $NUM_ASIC) ]]; do
82+
debug "Stopping syncd$asic_num process..."
83+
docker exec -i syncd$asic_num /usr/bin/syncd_request_shutdown --cold > /dev/null
84+
((asic_num = asic_num + 1))
85+
done
86+
else
87+
debug "Stopping syncd process..."
88+
docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null
89+
fi
7790
sleep 3
7891
fi
7992
stop_pmon_service

0 commit comments

Comments
 (0)