diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/plugins/Makefile.am | 6 | ||||
-rw-r--r-- | lib/plugins/RunApp.cpp | 78 | ||||
-rw-r--r-- | lib/plugins/RunApp.h | 34 | ||||
-rw-r--r-- | lib/plugins/abrt-RunApp.7 | 43 | ||||
-rw-r--r-- | lib/plugins/abrt-plugins.7 | 1 | ||||
-rw-r--r-- | lib/utils/test.cpp | 2 |
6 files changed, 0 insertions, 164 deletions
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 <string> -#include <vector> - -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 <zprikryl@redhat.com>. Manual -page by Daniel Novotny <dnovotny@redhat.com>. 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 <zprikryl@redhat.com> 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; |