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

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

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [warmboot] mount folder to hold warmboot temporary files

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* Fix a typo
This commit is contained in:
Ying Xie 2018-10-01 19:01:04 -07:00 committed by GitHub
parent 3c687744af
commit c8e6b15504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -56,6 +56,8 @@ start() {
lock_service_state_change
mkdir -p /host/warmboot
wait_for_database_service
check_warm_boot
@ -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..."

View File

@ -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