From 20e244b289376e80279b704c1c92c8ab93c40dba Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 4 Mar 2019 18:17:06 +0000 Subject: [PATCH] [swss/syncd] cold start syncd service in swss in attach method start() is called by service startPre method, which is blocking. Starting syncd service here is causing deadlock. attach() is called by service start method, which is non-blocking. Signed-off-by: Ying Xie --- files/scripts/swss.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index cdd2de332e3..107a2e81b4b 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -78,6 +78,14 @@ function clean_up_tables() end" 0 } +startPeerService() { + check_warm_boot + + if [[ x"$WARM_BOOT" != x"true" ]]; then + /bin/systemctl start ${PEER} + fi +} + start() { debug "Starting ${SERVICE} service..." @@ -105,13 +113,10 @@ start() { # Unlock has to happen before reaching out to peer service unlock_service_state_change - - if [[ x"$WARM_BOOT" != x"true" ]]; then - /bin/systemctl start ${PEER} - fi } attach() { + startPeerService /usr/bin/${SERVICE}.sh attach }