From 028af519c11d4bc3599562bc8a23caf66d50ea2e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 8 Nov 2010 19:07:48 +0100 Subject: remove RunApp plugin, abrt-event.conf superseded it Signed-off-by: Denys Vlasenko --- abrt.spec | 17 ++-------- examples/oops3.test | 2 -- lib/plugins/Makefile.am | 6 ---- lib/plugins/RunApp.cpp | 78 ---------------------------------------------- lib/plugins/RunApp.h | 34 -------------------- lib/plugins/abrt-RunApp.7 | 43 ------------------------- lib/plugins/abrt-plugins.7 | 1 - lib/utils/test.cpp | 2 -- src/daemon/abrt.conf | 1 - 9 files changed, 2 insertions(+), 182 deletions(-) delete mode 100644 lib/plugins/RunApp.cpp delete mode 100644 lib/plugins/RunApp.h delete mode 100644 lib/plugins/abrt-RunApp.7 diff --git a/abrt.spec b/abrt.spec index 36016da3..90e58c0e 100644 --- a/abrt.spec +++ b/abrt.spec @@ -133,14 +133,6 @@ Requires: mailx The simple reporter plugin which sends a report via mailx to a specified email address. -%package plugin-runapp -Summary: %{name}'s runapp plugin -Group: System Environment/Libraries -Requires: %{name} = %{version}-%{release} - -%description plugin-runapp -Plugin to run external programs. - %package plugin-sosreport Summary: %{name}'s sosreport plugin Group: System Environment/Libraries @@ -203,7 +195,7 @@ Group: User Interface/Desktops Requires: %{name} = %{version}-%{release} Requires: abrt-addon-kerneloops Requires: abrt-addon-ccpp, abrt-addon-python -Requires: abrt-plugin-bugzilla, abrt-plugin-logger, abrt-plugin-runapp +Requires: abrt-plugin-bugzilla, abrt-plugin-logger %description cli This package contains simple command line client for controlling abrt daemon over @@ -223,7 +215,7 @@ Requires: abrt-addon-ccpp, abrt-addon-python # Default config of addon-ccpp requires gdb Requires: gdb >= 7.0-3 Requires: abrt-gui -Requires: abrt-plugin-logger, abrt-plugin-bugzilla, abrt-plugin-runapp +Requires: abrt-plugin-logger, abrt-plugin-bugzilla #Requires: abrt-plugin-firefox Obsoletes: bug-buddy Provides: bug-buddy @@ -438,11 +430,6 @@ fi %{_libdir}/%{name}/Mailx.glade %{_mandir}/man7/abrt-Mailx.7.gz -%files plugin-runapp -%defattr(-,root,root,-) -%{_libdir}/%{name}/libRunApp.so* -%{_mandir}/man7/abrt-RunApp.7.gz - %files plugin-sosreport %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/%{name}/plugins/SOSreport.conf diff --git a/examples/oops3.test b/examples/oops3.test index a15b8527..d66cbe93 100644 --- a/examples/oops3.test +++ b/examples/oops3.test @@ -75,7 +75,6 @@ Nov 19 12:37:09 localhost dnsmasq[1530]: using nameserver 10.34.32.125#53 Nov 19 12:38:08 localhost abrtd: Directory 'kerneloops-1258630688-1' creation detected Nov 19 12:38:08 localhost abrtd: Getting local universal unique identification Nov 19 12:38:08 localhost abrtd: New crash, saving -Nov 19 12:38:08 localhost abrtd: Activation of plugin 'RunApp' was not successful: Plugin 'RunApp' is not registered Nov 19 12:39:46 localhost abrtd: Getting crash infos... Nov 19 12:39:51 localhost abrtd: Creating report... Nov 19 12:39:51 localhost abrtd: Getting local universal unique identification @@ -217,7 +216,6 @@ Nov 19 16:04:04 localhost kernel: Fixing recursive fault but reboot is needed! Nov 19 16:04:31 localhost abrtd: Directory 'kerneloops-1258643071-1' creation detected Nov 19 16:04:31 localhost abrtd: Getting local universal unique identification Nov 19 16:04:31 localhost abrtd: New crash, saving -Nov 19 16:04:31 localhost abrtd: Activation of plugin 'RunApp' was not successful: Plugin 'RunApp' is not registered Nov 19 16:04:32 localhost kernel: ACPI: \_SB_.GDCK - undocking Nov 19 16:04:32 localhost kernel: usb 1-6: USB disconnect, address 2 Nov 19 16:04:32 localhost kernel: usb 1-6.4: USB disconnect, address 5 diff --git a/lib/plugins/Makefile.am b/lib/plugins/Makefile.am index 537589ec..02112215 100644 --- a/lib/plugins/Makefile.am +++ b/lib/plugins/Makefile.am @@ -8,7 +8,6 @@ pluginslib_LTLIBRARIES = \ libKerneloopsScanner.la\ libKerneloops.la \ libKerneloopsReporter.la \ - libRunApp.la \ libSOSreport.la \ libBugzilla.la \ libRHTSupport.la \ @@ -47,7 +46,6 @@ man_MANS = \ abrt-Mailx.7 \ abrt-plugins.7 \ abrt-SQLite3.7 \ - abrt-RunApp.7 \ abrt-ReportUploader.7 EXTRA_DIST = $(man_MANS) @@ -104,10 +102,6 @@ libLogger_la_SOURCES = Logger.cpp Logger.h libLogger_la_LDFLAGS = -avoid-version libLogger_la_CPPFLAGS = -I$(INC_PATH) -I$(UTILS_PATH) -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" -# RunApp -libRunApp_la_SOURCES = RunApp.h RunApp.cpp -libRunApp_la_LDFLAGS = -avoid-version - # SOSreport libSOSreport_la_SOURCES = SOSreport.cpp SOSreport.h libSOSreport_la_LDFLAGS = -avoid-version diff --git a/lib/plugins/RunApp.cpp b/lib/plugins/RunApp.cpp deleted file mode 100644 index b606537a..00000000 --- a/lib/plugins/RunApp.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - RunApp.cpp - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include "abrtlib.h" -#include "RunApp.h" -#include "abrt_exception.h" -#include "comm_layer_inner.h" -#include "abrtlib.h" - -#define COMMAND 0 -#define FILENAME 1 - -using namespace std; - -void CActionRunApp::Run(const char *pActionDir, const char *pArgs, int force) -{ - /* Don't update_client() - actions run at crash time, there is no client - * to talk to at that point */ - log("RunApp('%s','%s')", pActionDir, pArgs); - - vector_string_t args; - parse_args(pArgs, args, '"'); - - if (args.size() <= COMMAND) - { - return; - } - const char *cmd = args[COMMAND].c_str(); - if (!cmd[0]) - { - return; - } - - /* NB: we chdir to the dump dir. Command can analyze component and such. - * Example: - * test x"`cat component`" = x"xorg-x11-apps" && cp /var/log/Xorg.0.log . - */ - size_t cmd_out_size; - char *cmd_out = run_in_shell_and_save_output(/*flags:*/ 0, cmd, pActionDir, &cmd_out_size); - - if (args.size() > FILENAME) - { - struct dump_dir *dd = dd_opendir(pActionDir, /*flags:*/ 0); - if (!dd) - return; - - dd_save_binary(dd, args[FILENAME].c_str(), cmd_out, cmd_out_size); - dd_close(dd); - } - - free(cmd_out); -} - -PLUGIN_INFO(ACTION, - CActionRunApp, - "RunApp", - "0.0.1", - _("Runs a command, saves its output"), - "zprikryl@redhat.com", - "https://fedorahosted.org/abrt/wiki", - ""); diff --git a/lib/plugins/RunApp.h b/lib/plugins/RunApp.h deleted file mode 100644 index 58f572d0..00000000 --- a/lib/plugins/RunApp.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - RunApp.h - Simple action plugin which execute command - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef RUNAPP_H_ -#define RUNAPP_H_ - -#include "action.h" -#include -#include - -class CActionRunApp : public CAction -{ - public: - virtual void Run(const char *pActionDir, const char *pArgs, int force); -}; - -#endif diff --git a/lib/plugins/abrt-RunApp.7 b/lib/plugins/abrt-RunApp.7 deleted file mode 100644 index 56a8d2b0..00000000 --- a/lib/plugins/abrt-RunApp.7 +++ /dev/null @@ -1,43 +0,0 @@ -.TH abrt "7" "1 Jun 2009" "" -.SH NAME -RunApp plugin for abrt(8) -.SH DESCRIPTION -.P -.I abrt -is a daemon that watches for application crashes. When a crash occurs, -it collects the crash data and takes action according to -its configuration. This manual page describes the \fIRunApp\fP plugin -for \fIabrt\fP. -.P -This plugin is used to run a specified application when the crash occurs. -.SH INVOCATION -The plugin is invoked in the \fIabrt.conf\fP configuration file. -The first parameter is the command to run. The second, optional -parameter specifies an output file, to which the standard -output of the program is saved. -.SH CONFIGURATION -There is no configuration file, the plugin parameters are -sufficient. -.SH EXAMPLES -.P -These are snippets from the \fIabrt.conf\fP configuration file. -.P -1) Each time something crashes, print (and save in a text file) -which processes are running on the system. -.PP -[common] -.br -ActionsAndReporters = RunApp("ps ax","processes.txt") -.P -2) When proftpd crashes, restart it. -.PP -[AnalyzerActionsAndReporters] -.br -CCpp:proftpd = RunApp("/etc/init.d/proftpd restart") -.SH "SEE ALSO" -.IR abrt (8), -.IR abrt.conf (5), -.IR abrt-plugins (7) -.SH AUTHOR -Written by Zdenek Prikryl . Manual -page by Daniel Novotny . diff --git a/lib/plugins/abrt-plugins.7 b/lib/plugins/abrt-plugins.7 index 3a99dcbb..6c07e65a 100644 --- a/lib/plugins/abrt-plugins.7 +++ b/lib/plugins/abrt-plugins.7 @@ -36,7 +36,6 @@ stored in the \fI/etc/abrt/plugins\fP directory. .IR abrt-KerneloopsScanner (7), .IR abrt-Logger (7), .IR abrt-Mailx (7), -.IR abrt-RunApp (7), .IR abrt-SQLite3 (7) .SH AUTHOR \fIabrt\fP written by Zdeněk Přikryl and diff --git a/lib/utils/test.cpp b/lib/utils/test.cpp index f2fe9584..a548dc21 100644 --- a/lib/utils/test.cpp +++ b/lib/utils/test.cpp @@ -43,13 +43,11 @@ int main(int argc, char** argv) middleWare.RegisterPlugin("CCpp"); middleWare.RegisterPlugin("Mailx"); middleWare.RegisterPlugin("Logger"); - middleWare.RegisterPlugin("RunApp"); middleWare.RegisterPlugin("SQLite3"); middleWare.SetDatabase("SQLite3"); middleWare.SetOpenGPGCheck(false); middleWare.AddActionOrReporter("Logger", ""); middleWare.AddAnalyzerActionOrReporter("CCpp", "Mailx", ""); - middleWare.AddAnalyzerActionOrReporter("CCpp", "RunApp", "date"); loaded_plugins = middleWare.GetPluginsInfo(); std::cout << "Loaded plugins" << std::endl; diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf index 9bae2c50..e84c28af 100644 --- a/src/daemon/abrt.conf +++ b/src/daemon/abrt.conf @@ -40,7 +40,6 @@ MaxCrashReportsSize = 1000 Kerneloops = KerneloopsReporter CCpp = Bugzilla, Logger Python = Bugzilla, Logger -#CCpp:xorg-x11-apps = RunApp("date", "date.txt") # Which Action plugins to run repeatedly -- cgit