rebind sighandlers
This commit is contained in:
parent
3de9b51a86
commit
1604f08e33
|
@ -2205,6 +2205,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand
|
|||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_db_handle_t *dbh, const char *sql, uint32_t retries);
|
||||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t *dbh, char *sql, uint32_t retries);
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_set_signal_handlers(void);
|
||||
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
|
||||
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void);
|
||||
SWITCH_DECLARE(const char *) switch_core_banner(void);
|
||||
|
|
|
@ -1772,27 +1772,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
|
|||
|
||||
runtime.runlevel++;
|
||||
|
||||
/* set signal handlers */
|
||||
signal(SIGINT, SIG_IGN);
|
||||
#ifdef SIGPIPE
|
||||
signal(SIGPIPE, handle_SIGPIPE);
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
signal(SIGQUIT, handle_SIGQUIT);
|
||||
#endif
|
||||
#ifdef SIGPOLL
|
||||
signal(SIGPOLL, handle_SIGPOLL);
|
||||
#endif
|
||||
#ifdef SIGIO
|
||||
signal(SIGIO, handle_SIGIO);
|
||||
#endif
|
||||
#ifdef TRAP_BUS
|
||||
signal(SIGBUS, handle_SIGBUS);
|
||||
#endif
|
||||
#ifdef SIGUSR1
|
||||
signal(SIGUSR1, handle_SIGHUP);
|
||||
#endif
|
||||
signal(SIGHUP, handle_SIGHUP);
|
||||
switch_core_set_signal_handlers();
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Loading Modules.\n");
|
||||
|
@ -1806,6 +1786,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
|
|||
|
||||
switch_load_core_config("post_load_switch.conf");
|
||||
|
||||
switch_core_set_signal_handlers();
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_STARTUP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Info", "System Ready");
|
||||
switch_event_fire(&event);
|
||||
|
@ -1869,6 +1851,31 @@ static void win_shutdown(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_set_signal_handlers(void)
|
||||
{
|
||||
/* set signal handlers */
|
||||
signal(SIGINT, SIG_IGN);
|
||||
#ifdef SIGPIPE
|
||||
signal(SIGPIPE, handle_SIGPIPE);
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
signal(SIGQUIT, handle_SIGQUIT);
|
||||
#endif
|
||||
#ifdef SIGPOLL
|
||||
signal(SIGPOLL, handle_SIGPOLL);
|
||||
#endif
|
||||
#ifdef SIGIO
|
||||
signal(SIGIO, handle_SIGIO);
|
||||
#endif
|
||||
#ifdef TRAP_BUS
|
||||
signal(SIGBUS, handle_SIGBUS);
|
||||
#endif
|
||||
#ifdef SIGUSR1
|
||||
signal(SIGUSR1, handle_SIGHUP);
|
||||
#endif
|
||||
signal(SIGHUP, handle_SIGHUP);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void)
|
||||
{
|
||||
return runtime.debug_level;
|
||||
|
|
|
@ -945,6 +945,8 @@ static switch_status_t switch_loadable_module_load_file(char *path, char *filena
|
|||
*new_module = module;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Successfully Loaded [%s]\n", module_interface->module_name);
|
||||
|
||||
switch_core_set_signal_handlers();
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue