Skip to content

Commit

Permalink
[dualtor][active-active]Killing radv instead of stopping on `active-a…
Browse files Browse the repository at this point in the history
…ctive` dualtor if config knob is on (#13408) (#13657)
  • Loading branch information
mssonicbld authored Feb 11, 2023
1 parent 9561738 commit f595eb8
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions files/scripts/service_mgmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ function check_fast_boot ()
fi
}

function check_redundant_type()
{
DEVICE_SUBTYPE=`$SONIC_DB_CLI CONFIG_DB hget "DEVICE_METADATA|localhost" subtype`
if [[ x"$DEVICE_SUBTYPE" == x"DualToR" ]]; then
MUX_CONFIG=`show muxcable config`
if [[ $MUX_CONFIG =~ .*active-active.* ]]; then
ACTIVE_ACTIVE="true"
else
ACTIVE_ACTIVE="false"
fi
else
ACTIVE_ACTIVE="false"
fi
CONFIG_KNOB=`$SONIC_DB_CLI CONFIG_DB hget "MUX_LINKMGR|SERVICE_MGMT" kill_radv`
if [[ x"$CONFIG_KNOB" != x"True" ]]; then
ACTIVE_ACTIVE='false'
fi
debug "DEVICE_SUBTYPE: ${DEVICE_SUBTYPE}, CONFIG_KNOB: ${CONFIG_KNOB}"
}

start() {
debug "Starting ${SERVICE}$DEV service..."

Expand All @@ -43,13 +63,19 @@ stop() {

check_warm_boot
check_fast_boot
check_redundant_type
debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}."
debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}."

# For WARM/FAST boot do not perform service stop
if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then
/usr/bin/${SERVICE}.sh stop $DEV
debug "Stopped ${SERVICE}$DEV service..."
if [[ x"$SERVICE" == x"radv" ]] && [[ x"$ACTIVE_ACTIVE" == x"true" ]]; then
debug "Killing Docker ${SERVICE}${DEV} for active-active dualtor device..."
/usr/bin/${SERVICE}.sh kill $DEV
else
/usr/bin/${SERVICE}.sh stop $DEV
debug "Stopped ${SERVICE}$DEV service..."
fi
else
debug "Killing Docker ${SERVICE}${DEV}..."
/usr/bin/${SERVICE}.sh kill $DEV
Expand Down

0 comments on commit f595eb8

Please sign in to comment.