Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[snmp] Sleep for 20 seconds before service starts #16588

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

lolyu
Copy link
Contributor

@lolyu lolyu commented Sep 19, 2023

Why I did it

Fixes #16486

Work item tracking
  • Microsoft ADO (number only): 24780690

How I did it

As snmp depends on intfmgrd to work, let's add a check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

How to verify it

Do config reload and confirms snmpd is started after intfmgrd setups all the loopback interfaces.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

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)

yxieca
yxieca previously approved these changes Sep 26, 2023
@@ -10,6 +10,7 @@ StartLimitIntervalSec=1200
StartLimitBurst=3

[Service]
ExecStartPre=-/usr/bin/sleep 20
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you test with ExecStartPre=/bin/bash -c "while pgrep intfmgrd > /dev/null; do sleep 1; done"? This has the advantage of documenting here that this needs the intfmgrd process to be running before this can be started (which in itself is a messy dependency) along with waiting only as much time as necessary before the snmp container is started.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@saiarcot895, updated, now the start pre action will check for intfmgrd running for at most 20 seconds.

Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@yxieca
Copy link
Contributor

yxieca commented Oct 13, 2023

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 072eaed into sonic-net:master Oct 13, 2023
16 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Oct 13, 2023
Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Oct 13, 2023
Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #16880

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #16881

yxieca pushed a commit that referenced this pull request Oct 14, 2023
Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Co-authored-by: Longxiang Lyu <35479537+lolyu@users.noreply.github.com>
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Oct 17, 2023
Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #16911

@mssonicbld
Copy link
Collaborator

@lolyu cherry pick PR didn't pass PR checker. Please check!!!
#16880

2 similar comments
@mssonicbld
Copy link
Collaborator

@lolyu cherry pick PR didn't pass PR checker. Please check!!!
#16880

@mssonicbld
Copy link
Collaborator

@lolyu cherry pick PR didn't pass PR checker. Please check!!!
#16880

mssonicbld pushed a commit that referenced this pull request Oct 20, 2023
Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld
Copy link
Collaborator

@lolyu cherry pick PR didn't pass PR checker. Please check!!!
#16911

mssonicbld pushed a commit that referenced this pull request Oct 21, 2023
Add pre start check to ensure intfmgrd is running.
The check will run for 20 seconds at most.

Signed-off-by: Longxiang Lyu <lolv@microsoft.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.

[202205][snmp] snmpd not running after config reload
5 participants