diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-01 18:47:50 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-01 18:47:50 +0100 |
| commit | 3b1dd4985ac7e32a3a1a498214bd26df29089dbc (patch) | |
| tree | 3c7366d29f387fa20db1b72cc2fec2a5a80f3d3e /lib | |
| parent | 7048013d2019b50b5b9af5a13d3f30e5cdafe4f8 (diff) | |
| download | abrt-3b1dd4985ac7e32a3a1a498214bd26df29089dbc.tar.gz abrt-3b1dd4985ac7e32a3a1a498214bd26df29089dbc.tar.xz abrt-3b1dd4985ac7e32a3a1a498214bd26df29089dbc.zip | |
introduce abrt_action.conf; use it for post-create step
This patch replaces only the post-create step with new logic
(the step which happens when abrtd detects fresh crash dump dir
and needs to decide what to do with it), but it turns out
this step is one of hard ones: it needs special handling
of UUID. So a good chunk of hard-ish stuff is already in this patch.
It also contains logic to collect the log from actions,
even though so far it is simply logged. Other steps
(like reporting step) will pipe it to clients.
post-create step simply has no client to pipe output to.
But the code is there already.
GetLocalUUID() members in all plugins are unused now
and are deleted from all classes.
Next patches will move run_event() function into libABRT,
so that it can be used from e.g. abrt-handle-crashdump utility
if/when we will write it, from clients directly and so on.
For now, it lives in MiddleWare.cpp since it is only used there.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/plugins/CCpp.cpp | 45 | ||||
| -rw-r--r-- | lib/plugins/CCpp.h | 1 | ||||
| -rw-r--r-- | lib/plugins/Kerneloops.cpp | 5 | ||||
| -rw-r--r-- | lib/plugins/Kerneloops.h | 1 | ||||
| -rw-r--r-- | lib/plugins/Python.cpp | 5 | ||||
| -rw-r--r-- | lib/plugins/Python.h | 1 |
6 files changed, 0 insertions, 58 deletions
diff --git a/lib/plugins/CCpp.cpp b/lib/plugins/CCpp.cpp index ed5ab3b6..7415891f 100644 --- a/lib/plugins/CCpp.cpp +++ b/lib/plugins/CCpp.cpp @@ -265,51 +265,6 @@ static void trim_debuginfo_cache(unsigned max_mb) } } -string CAnalyzerCCpp::GetLocalUUID(const char *pDebugDumpDir) -{ - string ret; - - struct dump_dir *dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0); - if (!dd) - return ret; /* "" */ - - if (!dd_exist(dd, CD_UUID)) - { - dd_close(dd); - - pid_t pid = fork(); - if (pid < 0) - { - perror_msg("fork"); - return ret; /* "" */ - } - if (pid == 0) /* child */ - { - char *argv[4]; /* abrt-action-analyze-c -d DIR <NULL> */ - char **pp = argv; - *pp++ = (char*)"abrt-action-analyze-c"; - *pp++ = (char*)"-d"; - *pp++ = (char*)pDebugDumpDir; - *pp = NULL; - - execvp(argv[0], argv); - perror_msg_and_die("Can't execute '%s'", argv[0]); - } - /* parent */ - waitpid(pid, NULL, 0); - - dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0); - if (!dd) - return ret; /* "" */ - } - - char *uuid = dd_load_text(dd, CD_UUID); - dd_close(dd); - ret = uuid; - free(uuid); - return ret; -} - string CAnalyzerCCpp::GetGlobalUUID(const char *pDebugDumpDir) { struct dump_dir *dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0); diff --git a/lib/plugins/CCpp.h b/lib/plugins/CCpp.h index d29a52e1..e8040449 100644 --- a/lib/plugins/CCpp.h +++ b/lib/plugins/CCpp.h @@ -41,7 +41,6 @@ class CAnalyzerCCpp : public CAnalyzer public: CAnalyzerCCpp(); - virtual std::string GetLocalUUID(const char *pDebugDumpDir); virtual std::string GetGlobalUUID(const char *pDebugDumpDir); virtual void CreateReport(const char *pDebugDumpDir, int force); virtual void Init(); diff --git a/lib/plugins/Kerneloops.cpp b/lib/plugins/Kerneloops.cpp index 47a18809..0a59681b 100644 --- a/lib/plugins/Kerneloops.cpp +++ b/lib/plugins/Kerneloops.cpp @@ -70,11 +70,6 @@ static string load(const char *dirname, const char *filename) return ret; } -string CAnalyzerKerneloops::GetLocalUUID(const char *pDebugDumpDir) -{ - return load(pDebugDumpDir, CD_UUID); -} - string CAnalyzerKerneloops::GetGlobalUUID(const char *pDebugDumpDir) { return load(pDebugDumpDir, FILENAME_DUPHASH); diff --git a/lib/plugins/Kerneloops.h b/lib/plugins/Kerneloops.h index cac2c526..10253fe4 100644 --- a/lib/plugins/Kerneloops.h +++ b/lib/plugins/Kerneloops.h @@ -34,7 +34,6 @@ class CAnalyzerKerneloops : public CAnalyzer { public: - virtual std::string GetLocalUUID(const char *pDebugDumpDir); virtual std::string GetGlobalUUID(const char *pDebugDumpDir); virtual void CreateReport(const char *pDebugDumpDir, int force) {} }; diff --git a/lib/plugins/Python.cpp b/lib/plugins/Python.cpp index eae1cdf1..9d625a1c 100644 --- a/lib/plugins/Python.cpp +++ b/lib/plugins/Python.cpp @@ -69,11 +69,6 @@ static string load(const char *dirname, const char *filename) return ret; } -string CAnalyzerPython::GetLocalUUID(const char *pDebugDumpDir) -{ - return load(pDebugDumpDir, CD_UUID); -} - string CAnalyzerPython::GetGlobalUUID(const char *pDebugDumpDir) { return load(pDebugDumpDir, FILENAME_DUPHASH); diff --git a/lib/plugins/Python.h b/lib/plugins/Python.h index 9f9395c5..ebb1ec6f 100644 --- a/lib/plugins/Python.h +++ b/lib/plugins/Python.h @@ -26,7 +26,6 @@ class CAnalyzerPython : public CAnalyzer { public: - virtual std::string GetLocalUUID(const char *pDebugDumpDir); virtual std::string GetGlobalUUID(const char *pDebugDumpDir); virtual void CreateReport(const char *pDebugDumpDir, int force) {} virtual void Init(); |
