-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[syncd]: Add socat and bcmsh wrapper #1657
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker exec -i syncd bcmsh "$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
usage="$(basename "$0") [-h] [-q] -- interactive shell for bcm service | ||
|
||
where: | ||
-h show this help text | ||
-q quite, no banner (default: verbose)" | ||
|
||
banner="Press Enter to show prompt. | ||
Press Ctrl+C to exit. | ||
Run command 'exit' will shutdown bcm service. | ||
" | ||
|
||
# Default verbose | ||
quiet=false | ||
|
||
while getopts 'hq' option; do | ||
case "$option" in | ||
h) echo "$usage" | ||
exit | ||
;; | ||
q) quiet=true | ||
;; | ||
\?) printf "illegal option: -%s\n" "$OPTARG" >&2 | ||
echo "$usage" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND - 1)) | ||
|
||
if [ "$quiet" = false ]; then | ||
echo "$banner" | ||
fi | ||
|
||
/usr/bin/socat - UNIX-CONNECT:/var/run/sswsyncd/sswsyncd.socket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like you to add in the base image. #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The domain socket file is inside docker-syncd-brcm. In reply to: 184841807 [](ancestors = 184841807) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. under /var/run/docker-syncd There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can have another wrapper script in base image to do docker exec -it .... #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realized that you are talking about debian base image. I prefer keep it inside brcm-syncd since it is a local specific troubleshooting tool, and not expected to be exposed to host users. The same idea is applied to platform provided dump/dbg/... tools. In reply to: 184862817 [](ancestors = 184862817) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we think this socket is only available in brcm platform, we should keep it in docker-syncd-brcm only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the drivshell, can we type quit or exit will that exit bcm shell? if yes, then we need to print out warning to warn user certain action will terminate syncd. what is the proper way to exit? we should print a banner to that too. |
||
|
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.
Based on my test, exit/quit won't exit the service, this is good so we don't accidentally shut down syncd. but we should remove this line of message
/usr/bin/socat - UNIX-CONNECT:/var/run/sswsyncd/sswsyncd.socket
Enter 'quit' to exit the application.
drivshell>exit
exit
Failed to execute the diagnostic command. Error: Invalid parameter.
drivshell>quit
quit
Exiting the application.
Hit enter to get drivshell prompt..
Enter 'quit' to exit the application.
drivshell>