Do not trap-and-ignore SIGTERM.
DIAL 1.0.5 sample code added a handler for SIGTERM, ignoring that
signal. Since pkillwait uses SIGTERM first with a timeout before it does
SIGKILL, the DIAL change makes the shutdown time longer. I see no reason
to trap and ignore SIGTERM in DIAL.
Change-Id: I8331f970783e9de25d7eb8463ba1a3632c06ad3e
diff --git a/src/server/main.c b/src/server/main.c
index 875f9c3..caa9d65 100644
--- a/src/server/main.c
+++ b/src/server/main.c
@@ -83,6 +83,9 @@
return match;
}
+// For Fiber we do not let DIAL handle SIGTERM, as we consider that a killing
+// signal (pkillwait uses it first).
+/*
void signalHandler(int signal)
{
switch(signal)
@@ -92,6 +95,7 @@
break;
}
}
+*/
/* The URL encoding source code was obtained here:
* http://www.geekhideout.com/urlcode.shtml
@@ -488,11 +492,14 @@
int main(int argc, char* argv[])
{
+ // We want DIAL to die on a SIGTERM - pkillwait sends SIGTERM first.
+ /*
struct sigaction action;
action.sa_handler = signalHandler;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGTERM, &action, NULL);
+ */
srand(time(NULL));
int i;