Skip to content

Commit

Permalink
Replace hard-coded fast-reboot with variable. And some typo correctio…
Browse files Browse the repository at this point in the history
…ns (#1254)

Cosmetic fix: One of the logging statements during warm-reboot incorrectly prints fast-reboot.
Fixes sonic-net/sonic-buildimage#5980

Fix: Remove hard-coded fast-reboot with REBOOT_TYPE variable.
      Additionally, corrected a few typos found in the comments.
  • Loading branch information
vaibhavhd committed Nov 20, 2020
1 parent 9d55082 commit 05c8e33
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function clear_warm_boot()
function init_warm_reboot_states()
{
# If the current running instanace was booted up with warm reboot. Then
# If the current running instance was booted up with warm reboot. Then
# the current DB contents will likely mark warm reboot is done.
# Clear these states so that the next boot up image won't get confused.
if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; then
Expand Down Expand Up @@ -472,8 +472,8 @@ setup_control_plane_assistant
if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; then
# Freeze orchagent for warm restart
# Ask orchagent_restart_check to try freeze 5 times with interval of 2 seconds,
# it is possible that the orchagent is in transient state and no opportunity to be freezed
# Note: assume that 2*5 seconds is enough for orchagent to process the request and respone freeze or not
# it is possible that the orchagent is in transient state and no opportunity to freeze
# Note: assume that 2*5 seconds is enough for orchagent to process the request and response to freeze or not
debug "Pausing orchagent ..."
docker exec -i swss /usr/bin/orchagent_restart_check -w 2000 -r 5 > /dev/null || RESTARTCHECK_RC=$?
if [[ RESTARTCHECK_RC -ne 0 ]]; then
Expand All @@ -486,12 +486,12 @@ if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; t
fi
fi
# We are fully committed to reboot from this point on becasue critical
# We are fully committed to reboot from this point on because critical
# service will go down and we cannot recover from it.
set +e
if [ -x ${LOG_SSD_HEALTH} ]; then
debug "Collecting logs to check ssd health before fast-reboot..."
debug "Collecting logs to check ssd health before ${REBOOT_TYPE}..."
${LOG_SSD_HEALTH}
fi
Expand All @@ -503,7 +503,7 @@ docker kill nat > /dev/null || true
systemctl stop nat
debug "Stopped nat ..."
# Kill radv before stopping BGP service to prevent annoucing our departure.
# Kill radv before stopping BGP service to prevent announcing our departure.
debug "Stopping radv service..."
systemctl stop radv
debug "Stopped radv service..."
Expand Down Expand Up @@ -660,7 +660,7 @@ if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN} ]; then
${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN}
fi
# Reboot: explicity call Linux native reboot under sbin
# Reboot: explicitly call Linux native reboot under sbin
debug "Rebooting with ${REBOOT_METHOD} to ${NEXT_SONIC_IMAGE} ..."
exec ${REBOOT_METHOD}
Expand Down

0 comments on commit 05c8e33

Please sign in to comment.