Skip to content

Commit

Permalink
[syncd] warn shutdown syncd process when warm boot is enabled (sonic-…
Browse files Browse the repository at this point in the history
…net#2078)

* [syncd] warn shutdown syncd process when warm boot is enabled

Signed-off-by: Ying Xie <[email protected]>

* [warmboot] mount folder to hold warmboot temporary files

Signed-off-by: Ying Xie <[email protected]>

* Fix a typo
  • Loading branch information
yxieca authored Oct 2, 2018
1 parent 3c68774 commit c8e6b15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit c8e6b15

Please sign in to comment.