Skip to content

Reapply "We should check service enabled instead exists (#24754)" (#24794)#25037

Merged
qiluo-msft merged 3 commits intosonic-net:masterfrom
qiluo-msft:qiluo/servicenable
Jan 18, 2026
Merged

Reapply "We should check service enabled instead exists (#24754)" (#24794)#25037
qiluo-msft merged 3 commits intosonic-net:masterfrom
qiluo-msft:qiluo/servicenable

Conversation

@qiluo-msft
Copy link
Collaborator

@qiluo-msft qiluo-msft commented Jan 13, 2026

Why I did it

If teamd feature is disabled,

sudo config feature state teamd disabled

swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

PORTS_PRESENT=$?

if [[ $PORTS_PRESENT == 0 ]] && [[ $(check_service_exists teamd) == "true" ]]; then
if [[ $PORTS_PRESENT == 0 ]] && [[ $(check_service_enabled teamd) == "true" ]]; then
Copy link
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.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft marked this pull request as ready for review January 17, 2026 17:22
@qiluo-msft qiluo-msft requested a review from lguohan as a code owner January 17, 2026 17:22
Copilot AI review requested due to automatic review settings January 17, 2026 17:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request reapplies a change that was previously introduced to check if systemd services are enabled rather than just checking if they exist. The change refactors the check_service_exists() function to check_service_enabled() and updates the implementation to use systemctl is-enabled instead of systemctl list-units.

Changes:

  • Renamed check_service_exists() function to check_service_enabled()
  • Changed implementation from checking service existence using systemctl list-units to checking if service is enabled using systemctl is-enabled
  • Updated function calls to use the new function name at lines 601 and 622

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 17, 2026 17:32
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #25123

@mssonicbld
Copy link
Collaborator

@qiluo-msft cherry pick PR didn't pass PR checker. Please check!!!
#25123

1 similar comment
@mssonicbld
Copy link
Collaborator

@qiluo-msft cherry pick PR didn't pass PR checker. Please check!!!
#25123

FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
)" (sonic-net#24794) (sonic-net#25037)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```

##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing sonic-net#24730

Signed-off-by: Feng Pan <fenpan@microsoft.com>
dprital pushed a commit that referenced this pull request Mar 19, 2026
…4794) (#25037)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```

##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing #24730

Signed-off-by: dprital <drorp@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants