summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2011-06-09 16:37:30 +0200
committerMiroslav Lichvar <mlichvar@redhat.com>2011-06-09 17:05:35 +0200
commitffbc6920a332db496dd633f3b7dec944c10d12bf (patch)
tree3dbfcf7f57928ba56835cecdc86cdf891bc5aeaf
parentaa851e935485de31e3c1008756fdd85deef5bb88 (diff)
downloadabrt-ffbc6920a332db496dd633f3b7dec944c10d12bf.zip
abrt-ffbc6920a332db496dd633f3b7dec944c10d12bf.tar.gz
abrt-ffbc6920a332db496dd633f3b7dec944c10d12bf.tar.xz
add abrt-ccpp systemd service (trac#288)
-rw-r--r--abrt.spec.in18
-rw-r--r--src/hooks/Makefile.am5
-rw-r--r--src/hooks/abrt-ccpp.service11
3 files changed, 31 insertions, 3 deletions
diff --git a/abrt.spec.in b/abrt.spec.in
index 3d9dd0d..c0e58f5 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -275,7 +275,13 @@ chown -R abrt:abrt %{_localstatedir}/cache/abrt-di
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add abrt-ccpp
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-ccpp.service >/dev/null 2>&1 || :
+fi
+%endif
%post addon-kerneloops
if [ $1 -eq 1 ]; then
@@ -307,8 +313,8 @@ if [ "$1" -eq "0" ] ; then
service abrt-ccpp stop >/dev/null 2>&1
/sbin/chkconfig --del abrt-ccpp
fi
-#systemd (not tested):
-%if 0
+#systemd
+%if %{?with_systemd}
if [ "$1" -eq "0" ] ; then
/bin/systemctl --no-reload disable abrt-ccpp.service >/dev/null 2>&1 || :
/bin/systemctl stop abrt-ccpp.service >/dev/null 2>&1 || :
@@ -335,6 +341,9 @@ fi
%postun addon-kerneloops
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%postun addon-ccpp
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
%endif
%post gui
@@ -432,6 +441,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/%{name}/plugins/CCpp.conf
%dir %attr(0775, abrt, abrt) %{_localstatedir}/cache/abrt-di
+%if %{?with_systemd}
+/lib/systemd/system/abrt-ccpp.service
+%endif
%{_initrddir}/abrt-ccpp
%{_libexecdir}/abrt-hook-ccpp
%{_bindir}/abrt-action-analyze-c
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am
index 49eddcf..95cd363 100644
--- a/src/hooks/Makefile.am
+++ b/src/hooks/Makefile.am
@@ -38,3 +38,8 @@ abrt_exception_handler.py:
# RPM fix: we need to regenerate abrt_exception_handler.py, because it has the default ddir
install-data-local:
sed s,\@VAR_RUN\@,\"$(VAR_RUN)\",g abrt_exception_handler.py.in > abrt_exception_handler.py
+
+if HAVE_SYSTEMD
+dist_systemdsystemunit_DATA = \
+ abrt-ccpp.service
+endif
diff --git a/src/hooks/abrt-ccpp.service b/src/hooks/abrt-ccpp.service
new file mode 100644
index 0000000..663322c
--- /dev/null
+++ b/src/hooks/abrt-ccpp.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Install ABRT coredump hook
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/abrt-install-ccpp-hook install
+ExecStop=/usr/sbin/abrt-install-ccpp-hook uninstall
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target