summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
}