We experimented with it: we made abrt-ccpp hook (de)installation
a separate service, and in my opinion it ended up a better
solution than making it a part of daemon. Among other reasons,
it makes abrt and abrt-addon-ccpp packages independent.
The patch below does the same for abrt-dump-oops.
Please take a look.
--
vda
diff -x '*.po' -d -urpN abrt.0/abrt-oops.init abrt.1/abrt-oops.init
--- abrt.0/abrt-oops.init 1970-01-01 01:00:00.000000000 +0100
+++ abrt.1/abrt-oops.init 2011-04-19 20:16:43.788884630 +0200
@@ -0,0 +1,97 @@
+#!/bin/bash
+# Start ABRT kernel log watcher
+#
+# chkconfig: 35 82 16
+# description: Watches system log for oops messages, creates ABRT dump directories for each oops
+### BEGIN INIT INFO
+# Provides: abrt-oops
+# Required-Start: $abrtd
+# Default-Stop: 0 1 2 6
+# Default-Start: 3 5
+# Short-Description: Watches system log for oops messages, creates ABRT dump directories for each oops
+# Description: Watches system log for oops messages, creates ABRT dump directories for each oops
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# For debugging
+dry_run=false
+verbose=false
+
+# We don't have pid files, therefore have to use
+# a flag file in /var/lock/subsys to enable GUI service tools
+# to figure out our status
+LOCK="/var/lock/subsys/abrt-oops"
+
+RETVAL=0
+
+check() {
+ # Check that we're a privileged user
+ [ "`id -u`" = 0 ] || exit 4
+}
+
+start() {
+ check
+ killall abrt-dump-oops 2>/dev/null
+ setsid abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages </dev/null >/dev/null 2>&1 &
+ $dry_run || touch -- "$LOCK"
+ return $RETVAL
+}
+
+stop() {
+ check
+ killall abrt-dump-oops
+ $dry_run || rm -f -- "$LOCK"
+ return $RETVAL
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+reload)
+ reload
+ ;;
+force-reload)
+ echo "$0: Unimplemented feature."
+ RETVAL=3
+ ;;
+restart)
+ restart
+ ;;
+condrestart)
+ # Is it already running?
+ if test -f -- "$LOCK"; then # yes
+ $verbose && printf "Running, restarting\n"
+ restart
+ fi
+ ;;
+status)
+ # Is it already running?
+ if test -f -- "$LOCK"; then # yes
+ $verbose && printf "Running\n"
+ RETVAL=0
+ else
+ $verbose && printf "Not running\n"
+ RETVAL=3 # "stopped normally"
+ fi
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+ RETVAL=2
+esac
+
+exit $RETVAL
diff -x '*.po' -d -urpN abrt.0/abrt.spec abrt.1/abrt.spec
--- abrt.0/abrt.spec 2011-04-20 11:46:00.770641918 +0200
+++ abrt.1/abrt.spec 2011-04-19 20:03:43.764134592 +0200
@@ -29,6 +29,7 @@ URL:
https://fedorahosted.org/abrt/
Source:
https://fedorahosted.org/released/%%7Bname%7D/%%7Bname%7D-%%7Bversion%7D.tar...
Source1: abrt.init
Source2: abrt-ccpp.init
+Source3: abrt-oops.init
BuildRequires: dbus-devel
BuildRequires: gtk2-devel
BuildRequires: curl-devel
@@ -281,6 +282,7 @@ find $RPM_BUILD_ROOT -name '*.la' -or -n
mkdir -p ${RPM_BUILD_ROOT}/%{_initrddir}
install -m 755 %SOURCE1 ${RPM_BUILD_ROOT}/%{_initrddir}/abrtd
install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}/%{_initrddir}/abrt-ccpp
+install -m 755 %SOURCE3 ${RPM_BUILD_ROOT}/%{_initrddir}/abrt-oops
mkdir -p $RPM_BUILD_ROOT/var/cache/abrt-di
mkdir -p $RPM_BUILD_ROOT/var/run/abrt
mkdir -p $RPM_BUILD_ROOT/var/spool/abrt
@@ -330,7 +332,13 @@ fi
# so 2.x fails when it tries to extract debuginfo there..
chown -R abrt:abrt %{_localstatedir}/cache/abrt-di
if [ $1 -eq 1 ]; then
-/sbin/chkconfig --add abrt-ccpp
+ /sbin/chkconfig --add abrt-ccpp
+fi
+#systemd: TODO
+
+%post addon-kerneloops
+if [ $1 -eq 1 ]; then
+ /sbin/chkconfig --add abrt-oops
fi
#systemd: TODO
@@ -340,27 +348,46 @@ fi
%preun
if [ "$1" -eq "0" ] ; then
- service abrtd stop >/dev/null 2>&1
- /sbin/chkconfig --del abrtd
+ service abrtd stop >/dev/null 2>&1
+ /sbin/chkconfig --del abrtd
fi
#systemd
%if %{?with_systemd}
if [ "$1" -eq "0" ] ; then
- /bin/systemctl stop abrtd.service >/dev/null 2>&1 || :
- /bin/systemctl disable abrtd.service >/dev/null 2>&1 || :
+ /bin/systemctl stop abrtd.service >/dev/null 2>&1 || :
+ /bin/systemctl disable abrtd.service >/dev/null 2>&1 || :
fi
%endif
%preun addon-ccpp
if [ "$1" -eq "0" ] ; then
- service abrt-ccpp stop >/dev/null 2>&1
- /sbin/chkconfig --del abrt-ccpp
+ service abrt-ccpp stop >/dev/null 2>&1
+ /sbin/chkconfig --del abrt-ccpp
fi
-#systemd: TODO
+#systemd (not tested):
+%if %{?with_systemd}
+if [ "$1" -eq "0" ] ; then
+ /bin/systemctl stop abrt-ccpp.service >/dev/null 2>&1 || :
+ /bin/systemctl disable abrt-ccpp.service >/dev/null 2>&1 || :
+fi
+%endif
+
+%preun addon-kerneloops
+if [ "$1" -eq "0" ] ; then
+ service abrt-oops stop >/dev/null 2>&1
+ /sbin/chkconfig --del abrt-oops
+fi
+#systemd (not tested):
+%if %{?with_systemd}
+if [ "$1" -eq "0" ] ; then
+ /bin/systemctl stop abrt-oops.service >/dev/null 2>&1 || :
+ /bin/systemctl disable abrt-oops.service >/dev/null 2>&1 || :
+fi
+%endif
%preun retrace-server
if [ "$1" = 0 ]; then
- /sbin/install-info --delete %{_infodir}/abrt-retrace-server %{_infodir}/dir 2> /dev/null || :
+ /sbin/install-info --delete %{_infodir}/abrt-retrace-server %{_infodir}/dir 2> /dev/null || :
fi
%postun
@@ -404,7 +431,23 @@ fi
if [ "$1" -eq "0" ]; then
service abrt-ccpp condrestart >/dev/null 2>&1 || :
fi
-#systemd: TODO
+#systemd
+%if %{?with_systemd}
+if [ "$1" -eq "0" ]; then
+ /bin/systemctl try-restart abrt-ccpp.service >/dev/null 2>&1 || :
+fi
+%endif
+
+%posttrans addon-kerneloops
+if [ "$1" -eq "0" ]; then
+ service abrt-oops condrestart >/dev/null 2>&1 || :
+fi
+#systemd
+%if %{?with_systemd}
+if [ "$1" -eq "0" ]; then
+ /bin/systemctl try-restart abrt-oops.service >/dev/null 2>&1 || :
+fi
+%endif
%files -f %{name}.lang
@@ -513,6 +556,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{name}/plugins/Kerneloops.conf
%{_sysconfdir}/%{name}/events/report_Kerneloops.xml
%config(noreplace) %{_sysconfdir}/%{name}/events.d/koops_events.conf
+%{_initrddir}/abrt-oops
%{_mandir}/man7/abrt-KerneloopsReporter.7.gz
%{_bindir}/abrt-dump-oops
%{_bindir}/abrt-action-analyze-oops
diff -x '*.po' -d -urpN abrt.0/dbg_mkrpm abrt.1/dbg_mkrpm
--- abrt.0/dbg_mkrpm 2011-04-14 13:16:10.000000000 +0200
+++ abrt.1/dbg_mkrpm 2011-04-19 20:06:05.000000000 +0200
@@ -31,8 +31,7 @@ mkdir "$BUILDDIR" 2>/dev/null
(tar -czf - -C "$T" "abrt-$ABRTVER") >"$BUILDDIR"/"abrt-$ABRTVER".tar.gz
rm -rf "$T"
cp "$SRCDIR"/abrt.spec "$BUILDDIR"
-cp "$SRCDIR"/abrt.init "$BUILDDIR"
-cp "$SRCDIR"/abrt-ccpp.init "$BUILDDIR"
+cp "$SRCDIR"/abrt*.init "$BUILDDIR"
#cp "$SRCDIR"/dbg_* "$BUILDDIR" 2>/dev/null # developers' toys
{
diff -x '*.po' -d -urpN abrt.0/src/daemon/abrt.conf abrt.1/src/daemon/abrt.conf
--- abrt.0/src/daemon/abrt.conf 2011-04-14 13:16:10.000000000 +0200
+++ abrt.1/src/daemon/abrt.conf 2011-04-19 20:00:42.490885024 +0200
@@ -30,7 +30,7 @@ BlackListedPaths = /usr/share/doc/*,*/ex
MaxCrashReportsSize = 1000
-# So far we support only one line here
-#
-[ LogScanners ]
-abrt-dump-oops = abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages
+### # So far we support only one line here
+### #
+### [ LogScanners ]
+### abrt-dump-oops = abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages