Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -584,15 +584,12 @@ function check_ports_present()
return 1
}

function check_service_exists()
function check_service_enabled()
{
systemctl list-units --full -all 2>/dev/null | grep -Fq $1
if [[ $? -eq 0 ]]; then
if systemctl is-enabled "$1" >/dev/null 2>&1; then
echo true
return
else
echo false
return
fi
}

Expand All @@ -601,7 +598,7 @@ function check_service_exists()
DEPENDENT=""
MULTI_INST_DEPENDENT=""

if [[ $(check_service_exists radv) == "true" ]]; then
if [[ $(check_service_enabled radv) == "true" ]]; then
DEPENDENT="$DEPENDENT radv"
fi

Expand All @@ -622,7 +619,7 @@ check_add_bgp_dependency
check_ports_present
PORTS_PRESENT=$?

if [[ $PORTS_PRESENT == 0 ]] && [[ $(check_service_exists teamd) == "true" ]]; then
if [[ $PORTS_PRESENT == 0 ]] && [[ $(check_service_enabled teamd) == "true" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

teamd is a per-ASIC container, meaning in a multi-ASIC setup, it will need to check teamd@0, teamd@1, etc.

MULTI_INST_DEPENDENT="teamd"
fi

Expand Down
Loading