From c3a8c73e24a0682f174a51df0672f5fae15c8c71 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Tue, 20 Nov 2018 21:44:43 +0000 Subject: [PATCH 1/2] [syncd] skip ledinit during syncd warm start Signed-off-by: Ying Xie --- files/scripts/syncd.sh | 9 +++++++-- platform/broadcom/docker-syncd-brcm/start.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 2d095d45aa33..40b5d770e0f1 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -64,8 +64,13 @@ start() { debug "Warm boot flag: ${SERVICE} ${WARM_BOOT}." - # Don't flush DB during warm boot - if [[ x"$WARM_BOOT" != x"true" ]]; then + if [[ x"$WARM_BOOT" == x"true" ]]; then + # Leave a mark for syncd scripts running inside docker. + touch /host/warmboot/warm-starting + else + rm -f /host/warmboot/warm-starting + + # Don't flush DB during warm boot /usr/bin/docker exec database redis-cli -n 1 FLUSHDB # platform specific tasks diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index 98c7d9c15a0d..d082bbf31dbd 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -39,7 +39,7 @@ fi supervisorctl start syncd # If this platform has an initialization file for the Broadcom LED microprocessor, load it -if [ -r ${PLATFORM_DIR}/led_proc_init.soc ]; then +if [ -r ${PLATFORM_DIR}/led_proc_init.soc && ! -f /var/warmboot/warm-starting ]; then wait_syncd supervisorctl start ledinit fi From 2d2afcca6d363d4aaf3cd2f35940c74c780705f8 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Wed, 21 Nov 2018 08:10:28 -0800 Subject: [PATCH 2/2] fix comments --- files/scripts/syncd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 40b5d770e0f1..ce593d6cbdfb 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -70,7 +70,7 @@ start() { else rm -f /host/warmboot/warm-starting - # Don't flush DB during warm boot + # Flush DB during non-warm start /usr/bin/docker exec database redis-cli -n 1 FLUSHDB # platform specific tasks