[interfaces-config] retry restart networking#25577
Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom Feb 24, 2026
Merged
[interfaces-config] retry restart networking#25577liat-grozovik merged 1 commit intosonic-net:masterfrom
liat-grozovik merged 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Ben Levi <belevi@nvidia.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
tshalvi
approved these changes
Feb 19, 2026
| for ((i=1; i<=MAX_RETRIES; i++)); do | ||
| LOG_MARK=$(date '+%Y-%m-%d %H:%M:%S') | ||
| if systemctl restart networking; then | ||
| if journalctl -u networking --since "$LOG_MARK" | grep -q "error.*already running"; then |
Collaborator
There was a problem hiding this comment.
So, even if "systemctl restart networking" return success, it could still hit the issue, right?
prsunny
approved these changes
Feb 23, 2026
Contributor
prsunny
left a comment
There was a problem hiding this comment.
lgtm, @saiarcot895 to review as well
Junchao-Mellanox
approved these changes
Feb 24, 2026
FengPan-Frank
pushed a commit
to FengPan-Frank/sonic-buildimage
that referenced
this pull request
Mar 6, 2026
- Why I did it The command "systemctl restart networking" uses "ifupdown" which has global file lock to prevent concurrent configurations. In some rare cases, we can get a timing conflict between simultaneous processes, and eth0 remains down. "error: Another instance of this program is already running" - How I did it Add a retry mechanism for the "systemctl restart networking" command. - How to verify it sudo ip link set eth0 down sudo flock -x /run/network/.lock sleep 7 & sudo systemctl restart interfaces-config.service Signed-off-by: Ben Levi <belevi@nvidia.com> Signed-off-by: Feng Pan <fenpan@microsoft.com>
dprital
pushed a commit
that referenced
this pull request
Mar 19, 2026
- Why I did it The command "systemctl restart networking" uses "ifupdown" which has global file lock to prevent concurrent configurations. In some rare cases, we can get a timing conflict between simultaneous processes, and eth0 remains down. "error: Another instance of this program is already running" - How I did it Add a retry mechanism for the "systemctl restart networking" command. - How to verify it sudo ip link set eth0 down sudo flock -x /run/network/.lock sleep 7 & sudo systemctl restart interfaces-config.service Signed-off-by: Ben Levi <belevi@nvidia.com> Signed-off-by: dprital <drorp@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
The command "systemctl restart networking" uses "ifupdown" which has global file lock to prevent concurrent configurations. In some rare cases, we can get a timing conflict between simultaneous processes,
and eth0 remains down.
"error: Another instance of this program is already running"
Work item tracking
How I did it
Add a retry mechanism for the "systemctl restart networking" command.
How to verify it
sudo ip link set eth0 down
sudo flock -x /run/network/.lock sleep 7 &
sudo systemctl restart interfaces-config.service
Which release branch to backport (provide reason below if selected)
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)