summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2011-06-08 14:45:24 +0200
committerMiroslav Lichvar <mlichvar@redhat.com>2011-06-09 17:05:35 +0200
commite495dd05e5c938008e9a1126985710b8e22d9ea6 (patch)
treef95deffc7a2c13559bb989213b034ad1e96a3f4c
parenteef34b06afaaa645fe0619a9316d386b8c64267c (diff)
downloadabrt-e495dd05e5c938008e9a1126985710b8e22d9ea6.tar.gz
abrt-e495dd05e5c938008e9a1126985710b8e22d9ea6.tar.xz
abrt-e495dd05e5c938008e9a1126985710b8e22d9ea6.zip
add abrt-oops systemd service (trac#287)
-rw-r--r--abrt.spec.in18
-rw-r--r--src/plugins/Makefile.am5
-rw-r--r--src/plugins/abrt-oops.service9
3 files changed, 29 insertions, 3 deletions
diff --git a/abrt.spec.in b/abrt.spec.in
index 1808fa64..8b622429 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -281,7 +281,13 @@ fi
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add abrt-oops
fi
-#systemd: TODO
+#systemd
+%if %{?with_systemd}
+if [ $1 -eq 1 ]; then
+ # Enable (but don't start) the units by default
+ /bin/systemctl enable abrt-oops.service >/dev/null 2>&1 || :
+fi
+%endif
%preun
if [ "$1" -eq "0" ] ; then
@@ -314,8 +320,8 @@ if [ "$1" -eq "0" ] ; then
service abrt-oops stop >/dev/null 2>&1
/sbin/chkconfig --del abrt-oops
fi
-#systemd (not tested):
-%if 0
+#systemd
+%if %{?with_systemd}
if [ "$1" -eq "0" ] ; then
/bin/systemctl --no-reload abrt-oops.service >/dev/null 2>&1 || :
/bin/systemctl stop abrt-oops.service >/dev/null 2>&1 || :
@@ -326,6 +332,9 @@ fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%postun addon-kerneloops
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
%endif
%post gui
@@ -447,6 +456,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%config(noreplace) %{_sysconfdir}/%{name}/plugins/Kerneloops.conf
%{_sysconfdir}/%{name}/events/report_Kerneloops.xml
%config(noreplace) %{_sysconfdir}/%{name}/events.d/koops_events.conf
+%if %{?with_systemd}
+/lib/systemd/system/abrt-oops.service
+%endif
%{_initrddir}/abrt-oops
%{_mandir}/man*/abrt-action-kerneloops.*
%{_bindir}/abrt-dump-oops
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index b041b060..a8d0f989 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -409,3 +409,8 @@ abrt_retrace_client_SOURCES = \
$(NSS_LIBS)
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+if HAVE_SYSTEMD
+dist_systemdsystemunit_DATA = \
+ abrt-oops.service
+endif
diff --git a/src/plugins/abrt-oops.service b/src/plugins/abrt-oops.service
new file mode 100644
index 00000000..4911e2ba
--- /dev/null
+++ b/src/plugins/abrt-oops.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=ABRT kernel log watcher
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages
+
+[Install]
+WantedBy=multi-user.target