Per Bug https://bugs.launchpad.net/openstack-ci/+bug/1024487, this will
modify the rate-limiting setting for rsyslog.conf. If rate-limiting is
being used the addition will set it to 0 otherwise the addition will
add the variables to the configuration file and set them to 0.
Implements: Variables "$SystemLogRateLimitBurst 0", and
"$SystemLogRateLimitInterval 0" in "/etc/rsyslog.conf". These changes
are persuent to what has been outlined in the rsyslog docs as found
here : http://www.rsyslog.com/tag/SystemLogRateLimitInterval/
Updated commit implements changes in code and placement post code
review. Recent change implements the "SystemLogRateLimitBurst" in first
if statement, which was "SystemLogRateLimitInterval" and wrong.
Fixes: Bug 1024487
Change-Id: I2637889cbe9e5e87bbfc0f1bb5047abae34d953c
| ... | ... |
@@ -754,6 +754,22 @@ EOF |
| 754 | 754 |
EOF |
| 755 | 755 |
sudo mv /tmp/90-stack-s.conf /etc/rsyslog.d |
| 756 | 756 |
fi |
| 757 |
+ |
|
| 758 |
+ RSYSLOGCONF="/etc/rsyslog.conf" |
|
| 759 |
+ if [ -f $RSYSLOGCONF ]; then |
|
| 760 |
+ sudo cp -b $RSYSLOGCONF $RSYSLOGCONF.bak |
|
| 761 |
+ if [[ $(grep '$SystemLogRateLimitBurst' $RSYSLOGCONF) ]]; then |
|
| 762 |
+ sudo sed -i 's/$SystemLogRateLimitBurst\ .*/$SystemLogRateLimitBurst\ 0/' $RSYSLOGCONF |
|
| 763 |
+ else |
|
| 764 |
+ sudo sed -i '$ i $SystemLogRateLimitBurst\ 0' $RSYSLOGCONF |
|
| 765 |
+ fi |
|
| 766 |
+ if [[ $(grep '$SystemLogRateLimitInterval' $RSYSLOGCONF) ]]; then |
|
| 767 |
+ sudo sed -i 's/$SystemLogRateLimitInterval\ .*/$SystemLogRateLimitInterval\ 0/' $RSYSLOGCONF |
|
| 768 |
+ else |
|
| 769 |
+ sudo sed -i '$ i $SystemLogRateLimitInterval\ 0' $RSYSLOGCONF |
|
| 770 |
+ fi |
|
| 771 |
+ fi |
|
| 772 |
+ |
|
| 757 | 773 |
echo_summary "Starting rsyslog" |
| 758 | 774 |
restart_service rsyslog |
| 759 | 775 |
fi |