From 105aab5e018efa7d68e06ff648d0dc9e434e20d2 Mon Sep 17 00:00:00 2001 From: Jakub Filak Date: Wed, 15 Oct 2014 13:33:51 +0200 Subject: [PATCH] make ABRT quieter Related: #1048384, #1147664 Signed-off-by: Jakub Filak --- src/daemon/abrtd.c | 7 +++++-- src/hooks/abrt-hook-ccpp.c | 10 +++++----- src/plugins/abrt-action-generate-core-backtrace.c | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c index b8426dd..cce49eb 100644 --- a/src/daemon/abrtd.c +++ b/src/daemon/abrtd.c @@ -626,7 +626,7 @@ int main(int argc, char** argv) s_signal_pipe_write = s_signal_pipe[1]; /* Enter the event loop */ - log("Init complete, entering main loop"); + log_debug("Init complete, entering main loop"); run_main_loop(pMainloop); cleanup: @@ -652,7 +652,10 @@ int main(int argc, char** argv) /* Exiting */ if (s_sig_caught && s_sig_caught != SIGALRM && s_sig_caught != SIGCHLD) { - error_msg("Got signal %d, exiting", s_sig_caught); + /* We use TERM to stop abrtd, so not printing out error message. */ + if (s_sig_caught != SIGTERM) + error_msg("Got signal %d, exiting", s_sig_caught); + signal(s_sig_caught, SIG_DFL); raise(s_sig_caught); } diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c index 8e141d4..6f471e9 100644 --- a/src/hooks/abrt-hook-ccpp.c +++ b/src/hooks/abrt-hook-ccpp.c @@ -184,13 +184,13 @@ static char* get_executable(pid_t pid, int *fd_p) if (deleted > executable && strcmp(deleted, " (deleted)") == 0) { *deleted = '\0'; - log("File '%s' seems to be deleted", executable); + log_info("File '%s' seems to be deleted", executable); } /* find and cut off prelink suffixes from the path */ char *prelink = executable + strlen(executable) - strlen(".#prelink#.XXXXXX"); if (prelink > executable && strncmp(prelink, ".#prelink#.", strlen(".#prelink#.")) == 0) { - log("File '%s' seems to be a prelink temporary file", executable); + log_info("File '%s' seems to be a prelink temporary file", executable); *prelink = '\0'; } return executable; @@ -649,7 +649,7 @@ int main(int argc, char** argv) * but it does not log file name */ error_msg_and_die("Error saving '%s'", path); } - log("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size); + log_notice("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size); return 0; } @@ -836,7 +836,7 @@ int main(int argc, char** argv) strcpy(path, newpath); free(newpath); - log("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size); + log_notice("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size); notify_new_path(path); @@ -874,7 +874,7 @@ int main(int argc, char** argv) unlink(core_basename); return 1; } - log("Saved core dump of pid %lu to %s (%llu bytes)", (long)pid, full_core_basename, (long long)core_size); + log_notice("Saved core dump of pid %lu to %s (%llu bytes)", (long)pid, full_core_basename, (long long)core_size); } return 0; diff --git a/src/plugins/abrt-action-generate-core-backtrace.c b/src/plugins/abrt-action-generate-core-backtrace.c index a992a5b..791af83 100644 --- a/src/plugins/abrt-action-generate-core-backtrace.c +++ b/src/plugins/abrt-action-generate-core-backtrace.c @@ -61,7 +61,7 @@ int main(int argc, char **argv) sr_debug_parser = true; /* Let user know what's going on */ - log(_("Generating core_backtrace")); + log_notice(_("Generating core_backtrace")); char *error_message = NULL; bool success; -- 2.1.0