Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Rotates the event logs
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/logrotate /etc/logrotate.d/logrotate.rsyslog
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Run rotate-event-logs.service every minute
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* *:*:00
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -0,0 +1,51 @@
|
||||
# if you experience problems, check
|
||||
# http://www.rsyslog.com/troubleshoot for assistance
|
||||
|
||||
# rsyslog v3: load input modules
|
||||
# If you do not load inputs, nothing happens!
|
||||
# You may need to set the module load path if modules are not found.
|
||||
#
|
||||
# Ported from debian's sysklogd.conf
|
||||
|
||||
# Journal-style logging
|
||||
# Limit to no more than 2000 entries in one minute and enable the
|
||||
# journal workaround to avoid duplicate entries
|
||||
module(load="imjournal" StateFile="/var/log/state"
|
||||
RateLimit.Interval="60"
|
||||
RateLimit.Burst="2000")
|
||||
|
||||
# Template for Redfish messages
|
||||
# "<timestamp> <MessageId>,<MessageArgs>"
|
||||
template(name="IPMISELTemplate" type="list") {
|
||||
property(name="timereported" dateFormat="rfc3339")
|
||||
constant(value=" ")
|
||||
property(name="$!IPMISEL_MESSAGE_ID")
|
||||
constant(value=", ")
|
||||
property(name="$!IPMISEL_MESSAGE_ARGS")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
# Template for Redfish messages
|
||||
# "<timestamp> <MessageId>,<MessageArgs>"
|
||||
template(name="RedfishTemplate" type="list") {
|
||||
property(name="timereported" dateFormat="rfc3339")
|
||||
constant(value=" ")
|
||||
property(name="$!REDFISH_MESSAGE_ID")
|
||||
constant(value=",")
|
||||
property(name="$!REDFISH_MESSAGE_ARGS")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
# If the journal entry has a IPMI SEL MESSAGE_ID, save as IPMI SEL
|
||||
if ($!IPMISEL_MESSAGE_ID != "") then {
|
||||
action(type="omfile" file="/var/log/ipmi_sel" template="IPMISELTemplate")
|
||||
}
|
||||
|
||||
# If the journal entry has a Redfish MessageId, save as a Redfish event
|
||||
if ($!REDFISH_MESSAGE_ID != "") then {
|
||||
action(type="omfile" file="/var/log/redfish" template="RedfishTemplate")
|
||||
}
|
||||
#
|
||||
# Include all config files in /etc/rsyslog.d/
|
||||
#
|
||||
$IncludeConfig /etc/rsyslog.d/*.conf
|
||||
@@ -0,0 +1,12 @@
|
||||
# /etc/logrotate.d/rsyslog - Ported from Debian
|
||||
|
||||
# Keep up to four 64k files for ipmi_sel (256k total)
|
||||
/var/log/ipmi_sel
|
||||
{
|
||||
rotate 3
|
||||
size 64k
|
||||
missingok
|
||||
postrotate
|
||||
systemctl reload rsyslog 2> /dev/null || true
|
||||
endscript
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI += "file://rsyslog.conf \
|
||||
file://rsyslog.logrotate \
|
||||
file://rotate-event-logs.service \
|
||||
file://rotate-event-logs.timer \
|
||||
"
|
||||
|
||||
PACKAGECONFIG:append = " imjournal klog imfile"
|
||||
|
||||
do_install:append() {
|
||||
install -m 0644 ${WORKDIR}/rotate-event-logs.service ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${WORKDIR}/rotate-event-logs.timer ${D}${systemd_system_unitdir}
|
||||
rm ${D}${sysconfdir}/rsyslog.d/imjournal.conf
|
||||
}
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += " rotate-event-logs.service rotate-event-logs.timer"
|
||||
@@ -0,0 +1,3 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
DEFAULT_TIMEZONE = "PST8PDT"
|
||||
Reference in New Issue
Block a user