|
|
baab13 |
From e0361b1688c82f9fbfa07d2683effedac870ae17 Mon Sep 17 00:00:00 2001
|
|
|
baab13 |
From: Matej Habrnal <mhabrnal@redhat.com>
|
|
|
baab13 |
Date: Mon, 13 Feb 2017 13:12:39 +0100
|
|
|
baab13 |
Subject: [PATCH] ccpp: add %h parameter into abrt-hook-ccpp
|
|
|
baab13 |
|
|
|
baab13 |
Without this commit core_pattern's parameter %h was not translated to hostname.
|
|
|
baab13 |
|
|
|
baab13 |
Example:
|
|
|
baab13 |
If 'core_pattern = core.%h.%e.%p.%t' the result was
|
|
|
baab13 |
core.%h.sleep.26284.1469805542 not core.myshostmane.sleep.26284.1469805542.
|
|
|
baab13 |
|
|
|
baab13 |
Related to #1364899
|
|
|
baab13 |
|
|
|
baab13 |
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
|
|
|
baab13 |
---
|
|
|
baab13 |
src/hooks/abrt-hook-ccpp.c | 6 +++---
|
|
|
baab13 |
src/hooks/abrt-install-ccpp-hook.in | 4 ++--
|
|
|
baab13 |
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
baab13 |
|
|
|
baab13 |
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
|
|
|
baab13 |
index 581a540..cb4d1e0 100644
|
|
|
baab13 |
--- a/src/hooks/abrt-hook-ccpp.c
|
|
|
baab13 |
+++ b/src/hooks/abrt-hook-ccpp.c
|
|
|
baab13 |
@@ -161,14 +161,14 @@ static struct dump_dir *dd;
|
|
|
baab13 |
* %g - gid
|
|
|
baab13 |
* %t - UNIX time of dump
|
|
|
baab13 |
* %e - executable filename
|
|
|
baab13 |
- * %I - global crash thread tid
|
|
|
baab13 |
* %P - global pid
|
|
|
baab13 |
+ * %I - global crash thread tid
|
|
|
baab13 |
+ * %h - hostname
|
|
|
baab13 |
* %% - output one "%"
|
|
|
baab13 |
*/
|
|
|
baab13 |
/* Hook must be installed with exactly the same sequence of %c specifiers.
|
|
|
baab13 |
- * Last one, %h, may be omitted (we can find it out).
|
|
|
baab13 |
*/
|
|
|
baab13 |
-static const char percent_specifiers[] = "%scpugtePI";
|
|
|
baab13 |
+static const char percent_specifiers[] = "%scpugtePIh";
|
|
|
baab13 |
static char *core_basename = (char*) "core";
|
|
|
baab13 |
|
|
|
baab13 |
static char* get_executable(pid_t pid, int *fd_p)
|
|
|
baab13 |
diff --git a/src/hooks/abrt-install-ccpp-hook.in b/src/hooks/abrt-install-ccpp-hook.in
|
|
|
baab13 |
index 707c57d..171bd4a 100755
|
|
|
baab13 |
--- a/src/hooks/abrt-install-ccpp-hook.in
|
|
|
baab13 |
+++ b/src/hooks/abrt-install-ccpp-hook.in
|
|
|
baab13 |
@@ -11,9 +11,9 @@ SAVED_PATTERN_DIR="@VAR_RUN@/abrt"
|
|
|
baab13 |
SAVED_PATTERN_FILE="@VAR_RUN@/abrt/saved_core_pattern"
|
|
|
baab13 |
HOOK_BIN="@libexecdir@/abrt-hook-ccpp"
|
|
|
baab13 |
# Must match percent_specifiers[] order in abrt-hook-ccpp.c:
|
|
|
baab13 |
-PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e %P %I"
|
|
|
baab13 |
+PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e %P %I %h"
|
|
|
baab13 |
# Same, but with bogus "executable name" parameter
|
|
|
baab13 |
-PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e %P %I"
|
|
|
baab13 |
+PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e %P %I %h"
|
|
|
baab13 |
|
|
|
baab13 |
# core_pipe_limit specifies how many dump_helpers can run at the same time
|
|
|
baab13 |
# 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing
|
|
|
baab13 |
--
|
|
|
baab13 |
1.8.3.1
|
|
|
baab13 |
|