summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-02-21 14:33:42 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-02-21 14:33:42 +0100
commitea1cb02edc2f7b7550ecb1c901d3dcaa3fd485c1 (patch)
tree7e9a3f766a743c6491741489c84ca99c21db711b
parent827e5f17df6fc207e52fcc263aebeb9395a46094 (diff)
downloadabrt-ea1cb02edc2f7b7550ecb1c901d3dcaa3fd485c1.tar.gz
abrt-ea1cb02edc2f7b7550ecb1c901d3dcaa3fd485c1.tar.xz
abrt-ea1cb02edc2f7b7550ecb1c901d3dcaa3fd485c1.zip
make abrt-ccpp service set /proc/sys/kernel/core_pipe_limit to 4
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--abrt-ccpp.init22
1 files changed, 22 insertions, 0 deletions
diff --git a/abrt-ccpp.init b/abrt-ccpp.init
index 457378a9..480cb1e8 100644
--- a/abrt-ccpp.init
+++ b/abrt-ccpp.init
@@ -29,6 +29,21 @@ SAVED_PATTERN_FILE="/var/run/abrt/saved_core_pattern"
HOOK_BIN="/usr/libexec/abrt-hook-ccpp"
PATTERN="|$HOOK_BIN /var/spool/abrt %s %c %p %u %g %t %h %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
+# process will be available for dump_helper.
+# 4 - means that 4 dump_helpers can run at the same time (the rest will also
+# run, but they will fail to read /proc/<pid>).
+#
+# This should be enough for ABRT, we can miss some crashes, but what are
+# the odds that more processes crash at the same time? And moreover,
+# do people want to save EVERY ONE of the crashes when they have
+# a crash storm? I don't think so.
+# The value of 4 has been recommended by nhorman.
+#
+CORE_PIPE_LIMIT_FILE="/proc/sys/kernel/core_pipe_limit"
+CORE_PIPE_LIMIT="4"
+
RETVAL=0
check() {
@@ -59,6 +74,13 @@ start() {
$verbose && printf "Installing to %s:'%s'\n" "$PATTERN_FILE" "${PATTERN}${OLD_PATTERN}"
$dry_run || echo "${PATTERN}${OLD_PATTERN}" >"$PATTERN_FILE"
$dry_run || touch -- "$LOCK"
+
+ # Check core_pipe_limit and change it if it's 0,
+ # otherwise the abrt-hook-ccpp won't be able to read /proc/<pid>
+ # of the crashing process
+ if test x"`cat "$CORE_PIPE_LIMIT_FILE"`" = x"0"; then
+ echo "$CORE_PIPE_LIMIT" >"$CORE_PIPE_LIMIT_FILE"
+ fi
fi
return $RETVAL
}