summaryrefslogtreecommitdiffstats
path: root/lib/Plugins
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-08-25 18:24:08 +0200
committerZdenek Prikryl <zprikryl@redhat.com>2009-08-25 18:24:08 +0200
commitef56b3c8afa0edfca2122c84343f6a35a3defb9e (patch)
treea538f0ba746591482d00818dea0ea9cef5401918 /lib/Plugins
parent0724397c1a2133a18f3783dd3429ba8cb2258ac1 (diff)
parent58e6c582c3103dac17f5575c6bd17ee7c0784f05 (diff)
downloadabrt-ef56b3c8afa0edfca2122c84343f6a35a3defb9e.tar.gz
abrt-ef56b3c8afa0edfca2122c84343f6a35a3defb9e.tar.xz
abrt-ef56b3c8afa0edfca2122c84343f6a35a3defb9e.zip
Merge branch 'master' of git://git.fedorahosted.org/abrt
Diffstat (limited to 'lib/Plugins')
-rw-r--r--lib/Plugins/KerneloopsScanner.cpp57
-rw-r--r--lib/Plugins/KerneloopsScanner.h6
2 files changed, 31 insertions, 32 deletions
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp
index 32289f3b..6c7ddffc 100644
--- a/lib/Plugins/KerneloopsScanner.cpp
+++ b/lib/Plugins/KerneloopsScanner.cpp
@@ -38,41 +38,44 @@
#define FILENAME_KERNELOOPS "kerneloops"
-void CKerneloopsScanner::Run(const std::string& pActionDir,
- const std::string& pArgs)
+// TODO: https://fedorahosted.org/abrt/ticket/78
+
+CKerneloopsScanner::CKerneloopsScanner()
{
int cnt_FoundOopses;
+ m_sSysLogFile = "/var/log/messages";
- /* Scan syslog file, on first call only */
- if (!m_bSysLogFileScanned)
- {
- cnt_FoundOopses = ScanSysLogFile(m_sSysLogFile.c_str());
- if (cnt_FoundOopses > 0) {
- SaveOopsToDebugDump();
- /*
- * This marker in syslog file prevents us from
- * re-parsing old oopses (any oops before it is
- * ignored by ScanSysLogFile()). The only problem
- * is that we can't be sure here that m_sSysLogFile
- * is the file where syslog(xxx) stuff ends up.
- */
- openlog("abrt", 0, LOG_KERN);
- syslog(
- LOG_WARNING,
- "Kerneloops: Reported %u kernel oopses to Abrt",
- cnt_FoundOopses
- );
- closelog();
- }
- m_bSysLogFileScanned = true;
- }
-
- /* Scan kernel's log buffer */
+ /* Scan dmesg, on first call only */
cnt_FoundOopses = ScanDmesg();
if (cnt_FoundOopses > 0)
SaveOopsToDebugDump();
}
+void CKerneloopsScanner::Run(const std::string& pActionDir,
+ const std::string& pArgs)
+{
+ int cnt_FoundOopses;
+
+ cnt_FoundOopses = ScanSysLogFile(m_sSysLogFile.c_str());
+ if (cnt_FoundOopses > 0) {
+ SaveOopsToDebugDump();
+ /*
+ * This marker in syslog file prevents us from
+ * re-parsing old oopses (any oops before it is
+ * ignored by ScanSysLogFile()). The only problem
+ * is that we can't be sure here that m_sSysLogFile
+ * is the file where syslog(xxx) stuff ends up.
+ */
+ openlog("abrt", 0, LOG_KERN);
+ syslog(
+ LOG_WARNING,
+ "Kerneloops: Reported %u kernel oopses to Abrt",
+ cnt_FoundOopses
+ );
+ closelog();
+ }
+}
+
void CKerneloopsScanner::SaveOopsToDebugDump()
{
comm_layer_inner_status("Creating kernel oops crash reports...");
diff --git a/lib/Plugins/KerneloopsScanner.h b/lib/Plugins/KerneloopsScanner.h
index ca19a3a4..981f187a 100644
--- a/lib/Plugins/KerneloopsScanner.h
+++ b/lib/Plugins/KerneloopsScanner.h
@@ -36,7 +36,6 @@ class CKerneloopsScanner : public CAction
private:
std::string m_sSysLogFile;
CSysLog m_pSysLog;
- bool m_bSysLogFileScanned;
public:
/* For standalone oops processor */
@@ -45,10 +44,7 @@ class CKerneloopsScanner : public CAction
int ScanSysLogFile(const char *filename);
/* Plugin interface */
- CKerneloopsScanner() :
- m_sSysLogFile("/var/log/messages"),
- m_bSysLogFileScanned(false)
- {}
+ CKerneloopsScanner();
virtual void Run(const std::string& pActionDir,
const std::string& pArgs);
virtual void SetSettings(const map_plugin_settings_t& pSettings);