return;
}
+static void handle_SIGTERM(int sig)
+{
+ int32_t arg = 0;
+ if (sig) {};
+ /* send shutdown signal to the freeswitch core */
+ switch_core_session_ctl(SCSC_SHUTDOWN_ELEGANT, &arg);
+ return;
+}
+
/* kill a freeswitch process running in background mode */
static int freeswitch_kill_background()
{
switch_bool_t win32_service = SWITCH_FALSE;
#endif
switch_bool_t nc = SWITCH_FALSE; /* TRUE if we are running in noconsole mode */
+ switch_bool_t elegant_term = SWITCH_FALSE;
pid_t pid = 0;
int i, x;
char *opts;
nf = SWITCH_TRUE;
}
+ else if (!strcmp(local_argv[x], "-elegant-term")) {
+ elegant_term = SWITCH_TRUE;
+ }
+
else if (!strcmp(local_argv[x], "-reincarnate")) {
reincarnate = SWITCH_TRUE;
}
#endif
#endif
signal(SIGILL, handle_SIGILL);
- signal(SIGTERM, handle_SIGILL);
+ if (elegant_term) {
+ signal(SIGTERM, handle_SIGTERM);
+ } else {
+ signal(SIGTERM, handle_SIGILL);
+ }
+
#ifndef WIN32
if (do_wait) {
if (pipe(fds)) {