From eb03ffaf3d6dc98fceebbf0ec77b1a27f36e2a65 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 27 Sep 2018 13:20:37 +0200 Subject: [PATCH] log opal-prd messages to /var/log/opal-prd.log --- opal-prd-logrotate | 9 +++++++++ opal-prd-rsyslog | 3 +++ opal-prd.spec | 14 +++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 opal-prd-logrotate create mode 100644 opal-prd-rsyslog diff --git a/opal-prd-logrotate b/opal-prd-logrotate new file mode 100644 index 0000000..e46b2b2 --- /dev/null +++ b/opal-prd-logrotate @@ -0,0 +1,9 @@ +/var/log/opal-prd.log { + monthly + rotate 12 + compress + delaycompress + missingok + notifempty + create 644 root root +} diff --git a/opal-prd-rsyslog b/opal-prd-rsyslog new file mode 100644 index 0000000..ce89e38 --- /dev/null +++ b/opal-prd-rsyslog @@ -0,0 +1,3 @@ +if $programname == 'opal-prd' then /var/log/opal-prd.log +if $programname == 'opal-prd' and $syslogseverity <= 4 then /var/log/messages +if $programname == 'opal-prd' then ~ diff --git a/opal-prd.spec b/opal-prd.spec index 9c0c9c0..d1bae57 100644 --- a/opal-prd.spec +++ b/opal-prd.spec @@ -2,7 +2,7 @@ Name: opal-prd Version: 6.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OPAL Processor Recovery Diagnostics Daemon Group: System Environment/Daemons @@ -24,6 +24,8 @@ Requires(preun): systemd Requires(postun): systemd Source0: https://github.com/open-power/%{project}/archive/v%{version}/%{project}-%{version}.tar.gz +Source1: opal-prd-rsyslog +Source2: opal-prd-logrotate Patch0: skiboot-6.0.4-crash.patch Patch1: skiboot-6.1-annocheck.patch @@ -87,6 +89,11 @@ mkdir -p %{buildroot}%{_datadir}/qemu install -m 644 -p skiboot.lid %{buildroot}%{_datadir}/qemu/skiboot.lid install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz +# log opal-prd messages to /var/log/opal-prd.log +mkdir -p %{buildroot}%{_sysconfdir}/{rsyslog.d,logrotate.d} +install -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/rsyslog.d/opal-prd +install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/10-opal-prd.conf + %post %systemd_post opal-prd.service @@ -99,6 +106,8 @@ install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz %files %doc README.md %license LICENCE +%config(noreplace) %{_sysconfdir}/logrotate.d/0-opal-prd.conf +%config(noreplace) %{_sysconfdir}/rsyslog.d/opal-prd %{_sbindir}/opal-prd %{_unitdir}/opal-prd.service %{_mandir}/man8/* @@ -118,6 +127,9 @@ install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz %{_datadir}/qemu/ %changelog +* Thu Sep 27 2018 Than Ngo - 6.1-4 +- log opal-prd messages to /var/log/opal-prd.log + * Fri Sep 21 2018 Than Ngo - 6.1-3 - Fixed opal-prd crash - Fixed annocheck distro flag failures