rsyslog-policy: Add rsyslog-override.conf
Create a rsyslog-policy recipe to add an override to the rsyslog
systemd service file to disable rate limiting.
The reason is that when a port is set by the user, the rsyslog restarts,
and if it restarts more than the value set in the StartLimitBurst within
an amount of time, the service file won't be restarted again. OpenBMC has
a default value of 2, which causes the rsyslog service to stop after 2 tries:
https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf
Tested:
Set a valid rsyslog address:
curl -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "x.x.xx.xx"}' https://${bmc}/xyz/openbmc_project/logging/config/remote/attr/Address
Then ran the following loop for an hour and observed the 'System Logging Service'
being restarted with no failures:
$ while true
> do
> curl -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 556}' https://${bmc}/xyz/openbmc_project/logging/config/remote/attr/Port
> sleep 1
> curl -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 557}' https://${bmc}/xyz/openbmc_project/logging/config/remote/attr/Port
> sleep 1
> curl -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 558}' https://${bmc}/xyz/openbmc_project/logging/config/remote/attr/Port
> sleep 1
> done
Change-Id: If82d0e6eee2f0d3dc786d2e6a0d00fae41f12e29
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/recipes-extended/rsyslog/rsyslog-policy.bb b/recipes-extended/rsyslog/rsyslog-policy.bb
new file mode 100644
index 0000000..7c9a61d
--- /dev/null
+++ b/recipes-extended/rsyslog/rsyslog-policy.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Policy configuration for rsyslog"
+PR = "r1"
+
+inherit obmc-phosphor-license
+
+DEPENDS += "rsyslog"
+
+FILES_${PN} += "${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf"
+
+SRC_URI += "file://rsyslog-override.conf"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}/rsyslog.service.d
+ install -m 0644 ${WORKDIR}/rsyslog-override.conf \
+ ${D}${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf
+}