From 5f12fdf735524501b37de909e65e319691509b70 Mon Sep 17 00:00:00 2001 From: mlok Date: Mon, 29 Apr 2024 22:59:43 -0400 Subject: [PATCH] [voq][chassis][dhcp_relay] swss.sh try to start the dhcp_relay service althoug it is masked Signed-off-by: mlok --- files/scripts/swss.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index cb51c0bb0021..8c7aa8947b9d 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -242,6 +242,17 @@ function clean_up_chassis_db_tables() } +is_feature_enabled() +{ + s=$1 + service=${s%@*} + state=$(sonic-db-cli CONFIG_DB hget "FEATURE|${service}" "state") + if [[ $state == "enabled" ]]; then + echo "true" + else + echo "false" + fi +} start_peer_and_dependent_services() { check_warm_boot @@ -254,7 +265,10 @@ start_peer_and_dependent_services() { fi done for dep in ${DEPENDENT}; do - /bin/systemctl start ${dep} + state=$(is_feature_enabled $dep) + if [[ $state == "true" ]]; then + /bin/systemctl start ${dep} + fi done for dep in ${MULTI_INST_DEPENDENT}; do if [[ ! -z $DEV ]]; then