Skip to content

Commit

Permalink
Set variables in rsyslog.conf to disable rate-limiting.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cloudnull committed May 29, 2013
1 parent eff1464 commit e4859f0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,22 @@ EOF
EOF
sudo mv /tmp/90-stack-s.conf /etc/rsyslog.d
fi

RSYSLOGCONF="/etc/rsyslog.conf"
if [ -f $RSYSLOGCONF ]; then
sudo cp -b $RSYSLOGCONF $RSYSLOGCONF.bak
if [[ $(grep '$SystemLogRateLimitBurst' $RSYSLOGCONF) ]]; then
sudo sed -i 's/$SystemLogRateLimitBurst\ .*/$SystemLogRateLimitBurst\ 0/' $RSYSLOGCONF
else
sudo sed -i '$ i $SystemLogRateLimitBurst\ 0' $RSYSLOGCONF
fi
if [[ $(grep '$SystemLogRateLimitInterval' $RSYSLOGCONF) ]]; then
sudo sed -i 's/$SystemLogRateLimitInterval\ .*/$SystemLogRateLimitInterval\ 0/' $RSYSLOGCONF
else
sudo sed -i '$ i $SystemLogRateLimitInterval\ 0' $RSYSLOGCONF
fi
fi

echo_summary "Starting rsyslog"
restart_service rsyslog
fi
Expand Down

0 comments on commit e4859f0

Please sign in to comment.