-
Notifications
You must be signed in to change notification settings - Fork 80
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
featured: use run() to run cli commands in place of check_call() #177
Open
anamehra
wants to merge
2
commits into
sonic-net:master
Choose a base branch
from
anamehra:anamehra/featured_1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Hi @abdosi , please review. |
anamehra
force-pushed
the
anamehra/featured_1
branch
2 times, most recently
from
October 31, 2024 23:19
feffc38
to
7b38356
Compare
Signed-off-by: anamehra [email protected]
anamehra
force-pushed
the
anamehra/featured_1
branch
from
October 31, 2024 23:54
a97c285
to
36cec0a
Compare
With run(), seeign extra data in buffer and causing order check failure: 2024-11-01T00:00:02.3225936Z E Actual: [call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), 2024-11-01T00:00:02.3226361Z E call().stdout.__str__(), 2024-11-01T00:00:02.3226594Z E call().stderr.__str__(), 2024-11-01T00:00:02.3227055Z E call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service'], capture_output=True, check=True, text=True), 2024-11-01T00:00:02.3227342Z E call().stdout.__str__(), 2024-11-01T00:00:02.3227570Z E call().stderr.__str__(),
anamehra
force-pushed
the
anamehra/featured_1
branch
from
November 1, 2024 00:14
01bf6a1
to
c268fb7
Compare
Hi @judyjoseph , please help with this PR review. Thanks |
judyjoseph
reviewed
Nov 13, 2024
judyjoseph
approved these changes
Nov 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
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.
Signed-off-by: anamehra [email protected]
Fixes: sonic-net/sonic-buildimage#20662
During some reboots, it was observed that some times featured.service script command fails to start the services like pmon, snmp, lldp etc.
From logs, it was observed that 'sudo systemctl enable ' command failed with errorcode 13 (SIGPIPE.
The issue does not recover and the pmon and other services never starts. On supervisor this also leads to swss, syncd and other related docker to stay down.
In general systemctl enable does not work for some services like pmon, snmp, lldp etc as there is no WantBy directive set for these services in unit file.
The command returns stderr :
featured python script uses subprocess.check_call() function to invoke the command which looks like is not very reliable at handling the stderr and may cause SIGPIPE with big buffer data.
Modifying the function to use subprocess.run() resolves this issue.
run() is more reliable at handing the return data.
Validated the change with multiple reboots.