[Multi Asic] support of swss.rec and sairedis.rec for multi asic (#6310)
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan arlakshm@microsoft.com - Why I did it This PR has the changes to support having different swss.rec and sairedis.rec for each asic. The logrotate script is updated as well - How I did it Update the orchagent.sh script to use the logfile name options in these PRs(Azure/sonic-swss#1546 and Azure/sonic-sairedis#747) In multi asic platforms the record files will be different for each asic, with the format swss.asic{x}.rec and sairedis.asic{x}.rec Update the logrotate script for multiasic platform .
This commit is contained in:
parent
d7517a704c
commit
d7be5a021a
@ -41,6 +41,11 @@ then
|
|||||||
ORCHAGENT_ARGS+="-i $asic_id "
|
ORCHAGENT_ARGS+="-i $asic_id "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# for multi asic platforms add the asic name to the record file names
|
||||||
|
if [[ "$NAMESPACE_ID" ]]; then
|
||||||
|
ORCHAGENT_ARGS+="-f swss.asic$NAMESPACE_ID.rec -j sairedis.asic$NAMESPACE_ID.rec "
|
||||||
|
fi
|
||||||
|
|
||||||
# Add platform specific arguments if necessary
|
# Add platform specific arguments if necessary
|
||||||
if [ "$platform" == "broadcom" ]; then
|
if [ "$platform" == "broadcom" ]; then
|
||||||
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
/var/log/telemetry.log
|
/var/log/telemetry.log
|
||||||
/var/log/frr/bgpd.log
|
/var/log/frr/bgpd.log
|
||||||
/var/log/frr/zebra.log
|
/var/log/frr/zebra.log
|
||||||
/var/log/swss/sairedis.rec
|
/var/log/swss/sairedis*.rec
|
||||||
/var/log/swss/swss.rec
|
/var/log/swss/swss*.rec
|
||||||
{
|
{
|
||||||
size 1M
|
size 1M
|
||||||
rotate 5000
|
rotate 5000
|
||||||
@ -85,7 +85,22 @@
|
|||||||
endscript
|
endscript
|
||||||
postrotate
|
postrotate
|
||||||
if [ $(echo $1 | grep -c "/var/log/swss/") -gt 0 ]; then
|
if [ $(echo $1 | grep -c "/var/log/swss/") -gt 0 ]; then
|
||||||
|
# for multi asic platforms, there are multiple orchagents
|
||||||
|
# send the SIGHUP only to the orchagent the which needs log file rotation
|
||||||
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
|
||||||
|
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf
|
||||||
|
if [ -f "$ASIC_CONF" ]; then
|
||||||
|
. $ASIC_CONF
|
||||||
|
fi
|
||||||
|
if [ $NUM_ASIC -gt 1 ]; then
|
||||||
|
log_file=$1
|
||||||
|
log_file_name=${log_file#/var/log/swss/}
|
||||||
|
logger -p syslog.info -t "logrotate" "Sending SIGHUP to OA log_file_name: $log_file_name"
|
||||||
|
pgrep -xa orchagent | grep $log_file_name | awk '{ print $1; }' | xargs /bin/kill -HUP 2>/dev/null || true
|
||||||
|
else
|
||||||
|
logger -p syslog.info -t "logrotate" "Sending SIGHUP to OA log_file_name: $1"
|
||||||
pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true
|
pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
/bin/kill -HUP $(cat /var/run/rsyslogd.pid)
|
/bin/kill -HUP $(cat /var/run/rsyslogd.pid)
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user