summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-06-15 09:21:21 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-06-15 11:57:47 +0200
commit38bcfdd3ccc0e27ef82ea08dd926941a81d963a4 (patch)
tree21ef5132f29151c524367b107b84bfa1fdee62db
parentc7197324b1e9e33260a1d9fd7e26528d9d562abc (diff)
downloadabrt-38bcfdd3ccc0e27ef82ea08dd926941a81d963a4.zip
abrt-38bcfdd3ccc0e27ef82ea08dd926941a81d963a4.tar.gz
abrt-38bcfdd3ccc0e27ef82ea08dd926941a81d963a4.tar.xz
[abrt] rhbz671354 - [RFE] Configurable core dump location
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rw-r--r--src/daemon/abrt.conf2
-rwxr-xr-xsrc/hooks/abrt-install-ccpp-hook14
2 files changed, 14 insertions, 2 deletions
diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf
index cb0dbbb..0946d7c 100644
--- a/src/daemon/abrt.conf
+++ b/src/daemon/abrt.conf
@@ -27,3 +27,5 @@ BlackListedPaths = /usr/share/doc/*,*/example*
# Max size for crash storage [MiB] or 0 for unlimited
#
MaxCrashReportsSize = 1000
+
+DumpLocation = /var/spool/abrt
diff --git a/src/hooks/abrt-install-ccpp-hook b/src/hooks/abrt-install-ccpp-hook
index 12a443f..a245aa2 100755
--- a/src/hooks/abrt-install-ccpp-hook
+++ b/src/hooks/abrt-install-ccpp-hook
@@ -6,14 +6,24 @@
dry_run=false
verbose=false
+DEFAULT_LOCATION=/var/spool/abrt
+
+DUMP_LOCATION=`cat /etc/abrt/abrt.conf | grep '^[ ]*DumpLocation'`
+DUMP_LOCATION=${DUMP_LOCATION#*DumpLocation*=}
+DUMP_LOCATION=${DUMP_LOCATION// /}
+
+if [ "$DUMP_LOCATION" = "" ]; then
+ DUMP_LOCATION=$DEFAULT_LOCATION
+fi
+
PATTERN_FILE="/proc/sys/kernel/core_pattern"
SAVED_PATTERN_DIR="/var/run/abrt"
SAVED_PATTERN_FILE="/var/run/abrt/saved_core_pattern"
HOOK_BIN="/usr/libexec/abrt-hook-ccpp"
# Must match percent_specifiers[] order in abrt-hook-ccpp.c:
-PATTERN="|$HOOK_BIN /var/spool/abrt %s %c %p %u %g %t %e"
+PATTERN="|$HOOK_BIN $DUMP_LOCATION %s %c %p %u %g %t %e"
# Same, but with bogus "executable name" parameter
-PATTERN1="|$HOOK_BIN /var/spool/abrt %s %c %p %u %g %t e"
+PATTERN1="|$HOOK_BIN $DUMP_LOCATION %s %c %p %u %g %t e"
# core_pipe_limit specifies how many dump_helpers can run at the same time
# 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing