Clean up systemd stuff

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-01-26 21:10:39 -05:00
parent c363b2eeed
commit 6b83ec2810
2 changed files with 6 additions and 20 deletions

View File

@ -1,6 +1,5 @@
[Unit]
Description=Machine Check Exception Logging Daemon
After=syslog.target
# FIXME - due to upstream kernel bug always start the mcelog process
# twice using the following ExecStartPre hack. This needs fixing.
@ -11,7 +10,6 @@ After=syslog.target
[Service]
ExecStartPre=/etc/mcelog/mcelog.setup
ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --foreground
StandardOutput=syslog
[Install]
WantedBy=multi-user.target

View File

@ -14,9 +14,9 @@ Source1: mcelog.conf
Source2: mcelog.service
Source10: mcelog.setup
ExclusiveArch: i686 x86_64
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: systemd
%description
@ -46,28 +46,16 @@ install -p -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/mcelog.service
install -p -m644 mcelog*.8 $RPM_BUILD_ROOT/%{_mandir}/man8/
install -p -m644 mcelog*.5 $RPM_BUILD_ROOT/%{_mandir}/man5/
%clean
rm -rf $RPM_BUILD_ROOT
%post
systemctl enable mcelog.service &> /dev/null ||
systemctl daemon-reload &> /dev/null
%systemd_post mcelog.service
%preun
# Handle removing mcelog
if [ "$1" -eq 0 ]; then
systemctl disable mcelog.service &> /dev/null
systemctl stop mcelog.service &> /dev/null
fi
%systemd_preun mcelog.service
%postun
# Handle upgrading mcelog
if [ "$1" -ge 1 ]; then
systemctl try-restart mcelog.service &> /dev/null
fi
%systemd_postun_with_restart mcelog.service
%files
%defattr(-,root,root,-)
%doc README CHANGES
%{_sbindir}/mcelog
%dir %{_sysconfdir}/mcelog