[ovs-dev] [PATCH] fatal-signal: Don't warn when terminated by SIGALRM.

Ethan Jackson ethan at nicira.com
Fri Oct 5 19:55:12 UTC 2012


An Open vSwitch daemon is only terminated by SIGALRM if the
--timeout option is specified on its command line.  Since the user
specifically requested this behavior, a WARN level log message is
too aggressive.  This patch downgrades the log message to an INFO
when terminated by a SIGALRM.

Bug #13476.
Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
 lib/fatal-signal.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c
index 7cfbd05..e3a5785 100644
--- a/lib/fatal-signal.c
+++ b/lib/fatal-signal.c
@@ -156,8 +156,11 @@ fatal_signal_run(void)
 
     sig_nr = stored_sig_nr;
     if (sig_nr != SIG_ATOMIC_MAX) {
-        VLOG_WARN("terminating with signal %d (%s)",
-                  (int)sig_nr, signal_name(sig_nr));
+        /* Alarms don't deserve warnings because they are requested by the user
+         * in the command line arguments. */
+        VLOG(sig_nr == SIGALRM ? VLL_INFO : VLL_WARN,
+             "terminating with signal %d (%s)", (int)sig_nr,
+             signal_name(sig_nr));
         call_hooks(sig_nr);
 
         /* Re-raise the signal with the default handling so that the program
-- 
1.7.12




More information about the dev mailing list