-
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
Changes to support bcmsh and swss logs on multi npu platforms #4783
Changes from all 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../x86_64-arista_common/pmon_daemon_control_skip_thermalctld.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"skip_thermalctld": true | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,15 @@ | |
/var/log/telemetry.log | ||
/var/log/quagga/bgpd.log | ||
/var/log/quagga/zebra.log | ||
{% if namespaces > 1 %} | ||
{% for ns in range(namespaces) %} | ||
/var/log/swss{{ns}}/sairedis.rec | ||
/var/log/swss{{ns}}/swss.rec | ||
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 am curious about other logs such as quagga, teamd? they are also running in the each namespace? are we aggregating all of them into one log file? 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 am not fan using templating everywhere. I think a better solution here is to add option to both swss and sairedis to allow specify the log file name, and we can use swss.asic{n}.rec, sairedis.asic{n}.rec. then, we do not need to use template for rsyslog file. In the future, if we need to dynamically incrase the asic number of the platform, there is no need to change this file. |
||
{% endfor %} | ||
{% else %} | ||
/var/log/swss/sairedis.rec | ||
/var/log/swss/swss.rec | ||
{% endif %} | ||
{ | ||
size 1M | ||
rotate 5000 | ||
|
@@ -84,10 +91,20 @@ | |
done | ||
endscript | ||
postrotate | ||
{% if namespaces > 1 %} | ||
{% for ns in range(namespaces) %} | ||
if [ $(echo $1 | grep -c "/var/log/swss{{ns}}/") -gt 0 ]; then | ||
pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true | ||
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. will this kill all orchagent instances? 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 probably do not need to do template here since, logrotate will pass the absolute path to the log file to this postrotate script, and from that absoluate path, you will know whethere it is multiasic or not, and which asic id it is if it is multi-asic. 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. maybe you should get into the container and do the pkill |
||
else | ||
/bin/kill -HUP $(cat /var/run/rsyslogd.pid) | ||
fi | ||
{% endfor %} | ||
{% else %} | ||
if [ $(echo $1 | grep -c "/var/log/swss/") -gt 0 ]; then | ||
pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true | ||
else | ||
/bin/kill -HUP $(cat /var/run/rsyslogd.pid) | ||
fi | ||
{% endif %} | ||
endscript | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,26 @@ | ||
#!/bin/bash | ||
|
||
sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog.conf.j2 >/etc/rsyslog.conf | ||
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 | ||
|
||
# On Multi NPU platforms we need to start the rsyslog server on the docker0 ip address | ||
# for the syslogs from the containers in the namespaces to work. | ||
# on Single NPU platforms we continue to use loopback adddres | ||
|
||
if [[ ($NUM_ASIC -gt 1) ]]; then | ||
udp_server_ip=$(ip -o -4 addr list docker0 | awk '{print $4}' | cut -d/ -f1) | ||
else | ||
udp_server_ip=$(ip -o -4 addr list lo scope host | awk '{print $4}' | cut -d/ -f1) | ||
fi | ||
|
||
sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog.conf.j2 -a "{\"udp_server_ip\": \"$udp_server_ip\"}" >/etc/rsyslog.conf | ||
|
||
#Render the logrotate config files for rsyslog as well. | ||
sonic-cfggen -d -t /usr/share/sonic/templates/logrotate-rsyslog.j2 -a "{\"namespaces\": $NUM_ASIC}" > /etc/logrotate.d/rsyslog | ||
|
||
systemctl restart rsyslog |
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