You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ig...@apache.org on 2013/01/15 21:10:57 UTC

[3/6] git commit: Handle SIGINT the same way as SIGTERM

Handle SIGINT the same way as SIGTERM

also, disable debugging again


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fc7c5343
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fc7c5343
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fc7c5343

Branch: refs/heads/3.2.x
Commit: fc7c53437d57bb48c283b9b9ae2ebd8f9ab0c1b1
Parents: ce7df45
Author: Igor Galić <i....@brainsware.org>
Authored: Tue Oct 30 22:29:46 2012 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Tue Jan 15 17:06:12 2013 +0100

----------------------------------------------------------------------
 cop/TrafficCop.cc |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fc7c5343/cop/TrafficCop.cc
----------------------------------------------------------------------
diff --git a/cop/TrafficCop.cc b/cop/TrafficCop.cc
index 84a3e1c..d393088 100644
--- a/cop/TrafficCop.cc
+++ b/cop/TrafficCop.cc
@@ -44,7 +44,7 @@ union semun
 #endif  // linux check
 
 // For debugging, turn this on.
-#define TRACE_LOG_COP 1
+// #define TRACE_LOG_COP 1
 
 #define OPTIONS_MAX     32
 #define OPTIONS_LEN_MAX 1024
@@ -1688,13 +1688,14 @@ init_signals()
   struct sigaction action;
 
   cop_log_trace("Entering init_signals()\n");
-  // Handle the SIGTERM signal: We simply do the same as
-  // in sig_child..
+  // Handle the SIGTERM and SIGINT signal:
+  // We kill the process group and wait() for all children
   action.sa_handler = sig_term;
   sigemptyset(&action.sa_mask);
   action.sa_flags = 0;
 
   sigaction(SIGTERM, &action, NULL);
+  sigaction(SIGINT, &action, NULL);
 
   // Handle the SIGCHLD signal. We simply reap all children that
   // die (which should only be spawned traffic_manager's).