summaryrefslogtreecommitdiffstats
path: root/src/daemon/Settings.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-01-17 16:39:11 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-01-17 16:39:11 +0100
commite796e95a4efbfeb04223f61c600c7712da7b500f (patch)
tree146d4bfe21c8fb6085041ec04198c4bc35663424 /src/daemon/Settings.cpp
parentf19d4af6c98ca2c45c1d2bf7f5085aa3fe690609 (diff)
downloadabrt-e796e95a4efbfeb04223f61c600c7712da7b500f.tar.gz
abrt-e796e95a4efbfeb04223f61c600c7712da7b500f.tar.xz
abrt-e796e95a4efbfeb04223f61c600c7712da7b500f.zip
replace KerneloopsScanner plugin and dumpoops with abrt-dump-oops, use it in abrtd
Patch adds new tool: $ abrt-dump-oops Usage: abrt-dump-oops [-vsrdow] FILE Extract oops from syslog/dmesg file -v, --verbose Be verbose -s Log to syslog -r Parse kernel's message buffer before parsing FILE -d Create ABRT dump for every oops found -o Print found oopses on standard output -w Do not exit, watch the file for new oopses It extends dumpoops. Extensions: * it can watch the syslog using -w option (uses inotify) * it can scan dmesg buffer too In this way, it also becomes a replacement for KerneloopsScanner plugin: oops-detecting logic is taken verbatim from KerneloopsScanner source. abrtd is changed to start it if it sees this directive in abrt.conf: [ LogScanners ] abrt-dump-oops = abrt-dump-oops -drw /var/log/messages Default abrt.conf is changed to have such line. Patch doesn't remove KerneloopsScanner plugin and dumpoops binary yet, I will do it in a separate trivial patch. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/daemon/Settings.cpp')
-rw-r--r--src/daemon/Settings.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/daemon/Settings.cpp b/src/daemon/Settings.cpp
index abdd0324..63453933 100644
--- a/src/daemon/Settings.cpp
+++ b/src/daemon/Settings.cpp
@@ -19,8 +19,9 @@
#include "abrtlib.h"
#include "Settings.h"
-#define SECTION_COMMON "Common"
-#define SECTION_CRON "Cron"
+#define SECTION_COMMON "Common"
+#define SECTION_LOG_SCANNERS "LogScanners"
+#define SECTION_CRON "Cron"
/* Conf file has this format:
* [ section_name1 ]
@@ -47,13 +48,16 @@ static map_string_t s_mapSectionCron;
/* one line: "OpenGPGCheck = value" */
bool g_settings_bOpenGPGCheck = false;
/* one line: "OpenGPGPublicKeys = value1,value2" */
-GList *g_settings_setOpenGPGPublicKeys = NULL;
-GList *g_settings_setBlackListedPkgs = NULL;
-GList *g_settings_setBlackListedPaths = NULL;
-char *g_settings_sWatchCrashdumpArchiveDir = NULL;
+GList * g_settings_setOpenGPGPublicKeys = NULL;
+GList * g_settings_setBlackListedPkgs = NULL;
+GList * g_settings_setBlackListedPaths = NULL;
+char * g_settings_sWatchCrashdumpArchiveDir = NULL;
unsigned int g_settings_nMaxCrashReportsSize = 1000;
bool g_settings_bProcessUnpackaged = false;
+/* [ LogScanners ] */
+char * g_settings_sLogScanners = NULL;
+
/* [ Cron ] */
/* many lines, one per key: "map_key = aa_first,bb_first(bb_second),cc_first" */
map_cron_t g_settings_mapCron;
@@ -277,7 +281,7 @@ static int ReadConfigurationFromFile(FILE *fp)
value += line[ii];
continue;
}
- if (isspace(line[ii]) && !is_quote)
+ if (isspace(line[ii]) && !is_quote && is_key)
{
continue;
}
@@ -304,8 +308,9 @@ static int ReadConfigurationFromFile(FILE *fp)
section += line[ii];
continue;
}
- if (line[ii] == '=' && !is_quote)
+ if (is_key && line[ii] == '=' && !is_quote)
{
+ while (isspace(line[ii + 1])) ii++;
is_key = false;
key = value;
value = "";
@@ -351,6 +356,10 @@ static int ReadConfigurationFromFile(FILE *fp)
s_mapSectionCommon[key] += ",";
s_mapSectionCommon[key] += value;
}
+ else if (section == SECTION_LOG_SCANNERS)
+ {
+ g_settings_sLogScanners = xstrdup(value.c_str());
+ }
else if (section == SECTION_CRON)
{
if (s_mapSectionCron[key] != "")