Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syncd] warn shutdown syncd process when warm boot is enabled #2078

Merged
merged 3 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ start() {

lock_service_state_change

mkdir -p /host/warmboot

wait_for_database_service
check_warm_boot

Expand Down Expand Up @@ -93,6 +95,19 @@ stop() {
check_warm_boot
debug "Warm boot flag: ${SERVICE} ${WARM_BOOT}."

if [[ x"$WARM_BOOT" == x"true" ]]; then
debug "Warm shutdown syncd process ..."
/usr/bin/docker exec -i syncd /usr/bin/syncd_request_shutdown --warm

# wait until syncd quits gracefully
while docker top syncd | grep -q /usr/bin/syncd; do
sleep 0.1
done

/usr/bin/docker exec -i syncd /bin/sync
debug "Finished warm shutdown syncd process ..."
fi

/usr/bin/${SERVICE}.sh stop
debug "Stopped ${SERVICE} service..."

Expand Down
1 change: 1 addition & 0 deletions platform/broadcom/docker-syncd-brcm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $(DOCKER_SYNCD_BRCM)_RUN_OPT += --net=host --privileged -t
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_SYNCD_BRCM)_RUN_OPT += -v /host/warmboot:/var/warmboot

$(DOCKER_SYNCD_BRCM)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd
$(DOCKER_SYNCD_BRCM)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh