log opal-prd messages to /var/log/opal-prd.log

This commit is contained in:
Than Ngo 2018-09-27 13:20:37 +02:00
parent f3308871f7
commit eb03ffaf3d
3 changed files with 25 additions and 1 deletions

9
opal-prd-logrotate Normal file
View File

@ -0,0 +1,9 @@
/var/log/opal-prd.log {
monthly
rotate 12
compress
delaycompress
missingok
notifempty
create 644 root root
}

3
opal-prd-rsyslog Normal file
View File

@ -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 ~

View File

@ -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 <than@redhat.com> - 6.1-4
- log opal-prd messages to /var/log/opal-prd.log
* Fri Sep 21 2018 Than Ngo <than@redhat.com> - 6.1-3
- Fixed opal-prd crash
- Fixed annocheck distro flag failures