From 591b445ba78c96cd91375fe79b2ac8a767131fb9 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 15 Jun 2011 14:34:50 +0200 Subject: move events and events config to libreport/events{.d} and libreport/plugins - requires libreport commit: 219c304236910086fae00e3a65fef626b46f1f1e --- abrt.spec.in | 41 +++++++++++++++++++---------------------- configure.ac | 6 ++++-- src/daemon/Makefile.am | 1 - src/daemon/smart_event.conf | 38 -------------------------------------- src/plugins/Makefile.am | 21 +++++++++++++-------- src/plugins/smart_event.conf | 38 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 71 deletions(-) delete mode 100644 src/daemon/smart_event.conf create mode 100644 src/plugins/smart_event.conf diff --git a/abrt.spec.in b/abrt.spec.in index 1a4c5662..9042e5ae 100644 --- a/abrt.spec.in +++ b/abrt.spec.in @@ -378,20 +378,17 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_bindir}/abrt-retrace-client %config(noreplace) %{_sysconfdir}/%{name}/abrt.conf %config(noreplace) %{_sysconfdir}/%{name}/gpg_keys -%config(noreplace) %{_sysconfdir}/%{name}/events.d/abrt_event.conf +%config(noreplace) %{_sysconfdir}/libreport/events.d/abrt_event.conf %config(noreplace) %{_sysconfdir}/dbus-1/system.d/dbus-abrt.conf -%{_sysconfdir}/%{name}/events.d/smart_event.conf +%config(noreplace) %{_sysconfdir}/libreport/events.d/smart_event.conf %dir %attr(0755, abrt, abrt) %{_localstatedir}/spool/%{name} %dir %attr(0700, abrt, abrt) %{_localstatedir}/spool/%{name}-upload %dir %attr(0775, abrt, abrt) %{_localstatedir}/run/%{name} %ghost %attr(0666, -, -) %{_localstatedir}/run/%{name}/abrt.socket %ghost %attr(0644, -, -) %{_localstatedir}/run/abrtd.pid -# libreport owns /etc/abrt -# %dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/plugins -%dir %{_sysconfdir}/%{name}/events.d -%dir %{_sysconfdir}/%{name}/events #%dir %{_libdir}/%{name} %{_mandir}/man8/abrtd.8.gz %{_mandir}/man5/abrt.conf.5.gz @@ -444,10 +441,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_bindir}/abrt-action-analyze-backtrace %{_bindir}/abrt-action-list-dsos.py* %{_sbindir}/abrt-install-ccpp-hook -%{_sysconfdir}/%{name}/events.d/ccpp_events.conf -%{_sysconfdir}/%{name}/events/analyze_LocalGDB.xml -%{_sysconfdir}/%{name}/events/analyze_RetraceServer.xml -%{_sysconfdir}/%{name}/events/analyze_xsession_errors.xml +%{_sysconfdir}/libreport/events.d/ccpp_events.conf +%{_sysconfdir}/libreport/events/analyze_LocalGDB.xml +%{_sysconfdir}/libreport/events/analyze_RetraceServer.xml +%{_sysconfdir}/libreport/events/analyze_xsession_errors.xml %{_mandir}/man*/abrt-action-trim-files.* %{_mandir}/man*/abrt-action-generate-backtrace.* %{_mandir}/man*/abrt-action-analyze-backtrace.* @@ -455,9 +452,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files addon-kerneloops %defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/%{name}/plugins/Kerneloops.conf -%{_sysconfdir}/%{name}/events/report_Kerneloops.xml -%config(noreplace) %{_sysconfdir}/%{name}/events.d/koops_events.conf +%config(noreplace) %{_sysconfdir}/libreport/plugins/Kerneloops.conf +%{_sysconfdir}/libreport/events/report_Kerneloops.xml +%config(noreplace) %{_sysconfdir}/libreport/events.d/koops_events.conf %if %{with systemd} /lib/systemd/system/abrt-oops.service %else @@ -470,36 +467,36 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files plugin-logger %defattr(-,root,root,-) -%{_sysconfdir}/%{name}/events/report_Logger.conf +%{_sysconfdir}/libreport/events/report_Logger.conf %{_bindir}/abrt-action-print %{_mandir}/man*/abrt-action-print.* %files plugin-mailx %defattr(-,root,root,-) -%{_sysconfdir}/%{name}/events/report_Mailx.xml -%config(noreplace) %{_sysconfdir}/%{name}/events.d/mailx_events.conf +%{_sysconfdir}/libreport/events/report_Mailx.xml +%config(noreplace) %{_sysconfdir}/libreport/events.d/mailx_events.conf %{_mandir}/man*/abrt-action-mailx.* %{_bindir}/abrt-action-mailx %files plugin-bugzilla %defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/%{name}/plugins/Bugzilla.conf -%{_sysconfdir}/%{name}/events/report_Bugzilla.xml -%config(noreplace) %{_sysconfdir}/%{name}/events/report_Bugzilla.conf +%config(noreplace) %{_sysconfdir}/libreport/plugins/Bugzilla.conf +%{_sysconfdir}/libreport/events/report_Bugzilla.xml +%config(noreplace) %{_sysconfdir}/libreport/events/report_Bugzilla.conf # FIXME: remove with the old gui %{_mandir}/man1/abrt-action-bugzilla.1.gz %{_bindir}/abrt-action-bugzilla %files plugin-rhtsupport %defattr(-,root,root,-) -%{_sysconfdir}/%{name}/events/report_RHTSupport.xml -%config(noreplace) %{_sysconfdir}/%{name}/events.d/rhtsupport_events.conf +%{_sysconfdir}/libreport/events/report_RHTSupport.xml +%config(noreplace) %{_sysconfdir}/libreport/events.d/rhtsupport_events.conf # {_mandir}/man7/abrt-RHTSupport.7.gz %{_bindir}/abrt-action-rhtsupport %files plugin-reportuploader %defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/%{name}/plugins/Upload.conf +%config(noreplace) %{_sysconfdir}/libreport/plugins/Upload.conf %{_mandir}/man*/abrt-action-upload.* %{_bindir}/abrt-action-upload diff --git a/configure.ac b/configure.ac index 7c42f474..3b2a6690 100644 --- a/configure.ac +++ b/configure.ac @@ -93,8 +93,9 @@ AC_CHECK_HEADER([sys/inotify.h], [], CONF_DIR='${sysconfdir}/${PACKAGE_NAME}' VAR_RUN='${localstatedir}/run' PLUGINS_CONF_DIR='${sysconfdir}/${PACKAGE_NAME}/plugins' -EVENTS_DIR='${sysconfdir}/${PACKAGE_NAME}/events' -EVENTS_CONF_DIR='${sysconfdir}/${PACKAGE_NAME}/events.d' +REPORT_PLUGINS_CONF_DIR='${sysconfdir}/libreport/plugins' +EVENTS_DIR='${sysconfdir}/libreport/events' +EVENTS_CONF_DIR='${sysconfdir}/libreport/events.d' PLUGINS_LIB_DIR='${libdir}/${PACKAGE_NAME}' ENABLE_SOCKET_OR_DBUS='-DENABLE_DBUS=1' LIBEXEC_DIR='${libexecdir}' @@ -115,6 +116,7 @@ AC_ARG_WITH(debuginfosdir, AC_SUBST(CONF_DIR) AC_SUBST(VAR_RUN) AC_SUBST(PLUGINS_CONF_DIR) +AC_SUBST(REPORT_PLUGINS_CONF_DIR) AC_SUBST(EVENTS_CONF_DIR) AC_SUBST(EVENTS_DIR) AC_SUBST(PLUGINS_LIB_DIR) diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index f2f90d69..426e6dcb 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -1,7 +1,6 @@ eventsconfdir = $(EVENTS_CONF_DIR) dist_eventsconf_DATA = \ - smart_event.conf \ abrt_event.conf bin_SCRIPTS = \ diff --git a/src/daemon/smart_event.conf b/src/daemon/smart_event.conf deleted file mode 100644 index 9c23862b..00000000 --- a/src/daemon/smart_event.conf +++ /dev/null @@ -1,38 +0,0 @@ -# Access to /dev/sda usually requires root. -# skdump is usually in /usr/sbin. -# Therefore we run it as post-create event, thus: under root. -# -# The code is identical for all three packages. -# -# To be moved to the packages, so that it is (de)installed -# together with these packages. - -# FIXME: not working yet, because program selection code -# looks at dump dir BEFORE running programs, -# thus, component is not created yet -# (it is created by 1st program in main .conf file) -# when program selection code looks at this file. - -EVENT=post-create component=gnome-disk-utility - which skdump >/dev/null 2>&1 || exit 0 - for f in /dev/[sh]d[a-z]; do - test -e "$f" || continue - skdump "$f" - echo - done >smart_data - -EVENT=post-create component=libatasmart - which skdump >/dev/null 2>&1 || exit 0 - for f in /dev/[sh]d[a-z]; do - test -e "$f" || continue - skdump "$f" - echo - done >smart_data - -EVENT=post-create component=udisks - which skdump >/dev/null 2>&1 || exit 0 - for f in /dev/[sh]d[a-z]; do - test -e "$f" || continue - skdump "$f" - echo - done >smart_data diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 352c23af..543b424c 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -27,7 +27,11 @@ bin_PROGRAMS = \ pluginsconfdir = $(PLUGINS_CONF_DIR) dist_pluginsconf_DATA = \ - Python.conf \ + Python.conf + +reportpluginsconfdir = $(REPORT_PLUGINS_CONF_DIR) + +dist_reportpluginsconf_DATA = \ Kerneloops.conf \ Bugzilla.conf \ Upload.conf @@ -53,7 +57,8 @@ dist_eventsconf_DATA = \ ccpp_events.conf \ mailx_events.conf \ koops_events.conf \ - rhtsupport_events.conf + rhtsupport_events.conf \ + smart_event.conf man_MANS = \ abrt-plugins.7 @@ -261,7 +266,7 @@ abrt_action_bugzilla_CPPFLAGS = \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DDEBUG_INFO_DIR=\"$(DEBUG_INFO_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ + -DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ -D_GNU_SOURCE \ @@ -284,7 +289,7 @@ abrt_action_rhtsupport_CPPFLAGS = \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DDEBUG_INFO_DIR=\"$(DEBUG_INFO_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ + -DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ $(XMLRPC_CFLAGS) $(XMLRPC_CLIENT_CFLAGS) \ @@ -309,7 +314,7 @@ abrt_action_upload_CPPFLAGS = \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DDEBUG_INFO_DIR=\"$(DEBUG_INFO_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ + -DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ $(CURL_CFLAGS) \ $(LIBREPORT_CFLAGS) \ @@ -333,7 +338,7 @@ abrt_action_kerneloops_CPPFLAGS = \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DDEBUG_INFO_DIR=\"$(DEBUG_INFO_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ + -DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ -D_GNU_SOURCE \ @@ -355,7 +360,7 @@ abrt_action_mailx_CPPFLAGS = \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DDEBUG_INFO_DIR=\"$(DEBUG_INFO_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ + -DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ -D_GNU_SOURCE \ @@ -375,7 +380,7 @@ abrt_action_print_CPPFLAGS = \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DDEBUG_INFO_DIR=\"$(DEBUG_INFO_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ + -DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ $(LIBREPORT_CFLAGS) \ -D_GNU_SOURCE \ diff --git a/src/plugins/smart_event.conf b/src/plugins/smart_event.conf new file mode 100644 index 00000000..9c23862b --- /dev/null +++ b/src/plugins/smart_event.conf @@ -0,0 +1,38 @@ +# Access to /dev/sda usually requires root. +# skdump is usually in /usr/sbin. +# Therefore we run it as post-create event, thus: under root. +# +# The code is identical for all three packages. +# +# To be moved to the packages, so that it is (de)installed +# together with these packages. + +# FIXME: not working yet, because program selection code +# looks at dump dir BEFORE running programs, +# thus, component is not created yet +# (it is created by 1st program in main .conf file) +# when program selection code looks at this file. + +EVENT=post-create component=gnome-disk-utility + which skdump >/dev/null 2>&1 || exit 0 + for f in /dev/[sh]d[a-z]; do + test -e "$f" || continue + skdump "$f" + echo + done >smart_data + +EVENT=post-create component=libatasmart + which skdump >/dev/null 2>&1 || exit 0 + for f in /dev/[sh]d[a-z]; do + test -e "$f" || continue + skdump "$f" + echo + done >smart_data + +EVENT=post-create component=udisks + which skdump >/dev/null 2>&1 || exit 0 + for f in /dev/[sh]d[a-z]; do + test -e "$f" || continue + skdump "$f" + echo + done >smart_data -- cgit