On 06/29/2010 05:03 PM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovsky<npajkovs(a)redhat.com>
---
src/Daemon/Daemon.cpp | 25 +++++++++++++++----------
src/Daemon/abrt.conf | 2 +-
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 6c61d4d..9667238 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -506,17 +506,22 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition
condition, gpoin
}
log("Directory '%s' creation detected", name);
- std::string worst_dir;
- while (g_settings_nMaxCrashReportsSize> 0
-&& get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR,&worst_dir, name) /
(1024*1024)>= g_settings_nMaxCrashReportsSize
-&& worst_dir != ""
- ) {
- log("Size of '%s'>= %u MB, deleting '%s'",
DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str());
- g_pCommLayer->QuotaExceed(_("Report size exceeded the quota. Please
check system's MaxCrashReportsSize value in abrt.conf."));
- /* deletes both directory and DB record */
- DeleteDebugDump_by_dir(concat_path_file(DEBUG_DUMPS_DIR,
worst_dir.c_str()).c_str());
- worst_dir = "";
+ if (g_settings_nMaxCrashReportsSize> 0)
+ {
+ std::string worst_dir;
+ while (g_settings_nMaxCrashReportsSize> 0
+&& get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR,&worst_dir, name) /
(1024*1024)>= g_settings_nMaxCrashReportsSize
+&& worst_dir != ""
+ ) {
+ log("Size of '%s'>= %u MB, deleting '%s'",
DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str());
+ g_pCommLayer->QuotaExceed(_("Report size exceeded the quota.
Please check system's MaxCrashReportsSize value in abrt.conf."));
+ /* deletes both directory and DB record */
+ DeleteDebugDump_by_dir(concat_path_file(DEBUG_DUMPS_DIR,
worst_dir.c_str()).c_str());
+ worst_dir = "";
+ }
}
+ else
+ log("MaxReportsSize is unlimited");
- I would change this message to say smth like:
"Quota for stored reports is unlimited (MaxReportsSize = 0)" the rest
seems ok.
try
{
diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf
index 6a70b82..dcbdba9 100644
--- a/src/Daemon/abrt.conf
+++ b/src/Daemon/abrt.conf
@@ -17,7 +17,7 @@ Database = SQLite3
# Note: you must ensure that whatever directory you specify here exists
# and is writable for abrtd. abrtd will not create it automatically.
#WatchCrashdumpArchiveDir = /var/spool/abrt-upload
-# Max size for crash storage [MiB]
+# Max size for crash storage [MiB] or 0 for unlimited
MaxCrashReportsSize = 1000
# Vector of actions and reporters which are activated immediately
# after a crash occurs, comma separated.