-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Changes to support bcmsh and swss logs on multi npu platforms #4783
Changes from 4 commits
6a4d512
ea3607f
8db1174
c660fc9
5f16e96
ef994a1
22bf545
ba234ab
6e1ae35
ed7fafc
2187144
243268f
e66cb47
2e0aa4f
b72fed7
cae65a4
a4253af
5f31842
c4b5b00
eebca91
4240c8c
0a260b7
90dcbe1
405033b
20698aa
e62b5f6
969a914
eb90fa0
afa4f1a
32a34f9
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 |
---|---|---|
@@ -1,3 +1,29 @@ | ||
#!/bin/bash | ||
function print_error() { | ||
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. are we duplicating the file here? 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. Fixed in the latest commit |
||
echo "No such container $NS" | ||
echo "usage bcmcmd <container name> <command>" | ||
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. what do you mean by ? should we just say bcmcmd -n [asicid] "cmd"? add an option seems better. 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. Changed to |
||
exit | ||
} | ||
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform` | ||
|
||
# Parse the device specific asic conf file, if it exists | ||
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf | ||
if [ -f "$ASIC_CONF" ]; then | ||
source $ASIC_CONF | ||
fi | ||
NS_PREFIX="syncd" | ||
if [[ ($NUM_ASIC -gt 1) ]]; then | ||
NS=$1 | ||
shift | ||
if [[ $NS == $NS_PREFIX* ]]; then | ||
DEV=${NS#"$NS_PREFIX"} | ||
if [ "$DEV" -ge $NUM_ASIC ] || [ "$DEV" -lt 0 ]; then | ||
print_error | ||
fi | ||
else | ||
print_error | ||
fi | ||
fi | ||
|
||
docker exec -i syncd$DEV bcmcmd "$@" | ||
|
||
docker exec -i syncd bcmcmd "$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
#!/bin/bash | ||
function print_error() { | ||
echo "No such container $NS" | ||
echo "usage bcmsh <container name>" | ||
exit | ||
} | ||
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform` | ||
|
||
docker exec -it syncd bcmsh "$@" | ||
# Parse the device specific asic conf file, if it exists | ||
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf | ||
if [ -f "$ASIC_CONF" ]; then | ||
source $ASIC_CONF | ||
fi | ||
NS_PREFIX="syncd" | ||
if [[ ($NUM_ASIC -gt 1) ]]; then | ||
NS=$1 | ||
shift | ||
if [[ $NS == $NS_PREFIX* ]]; then | ||
DEV=${NS#"$NS_PREFIX"} | ||
if [ "$DEV" -ge $NUM_ASIC ] || [ "$DEV" -lt 0 ]; then | ||
print_error | ||
fi | ||
else | ||
print_error | ||
fi | ||
fi | ||
|
||
docker exec -it syncd$DEV bcmsh "$@" |
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.
do we know if logrotate works if changed the place?
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.
Added changes for logrotation in the latest commit