static void handler()

in src/native/unix/native/jsvc-unix.c [89:136]


static void handler(int sig)
{
    switch (sig) {
        case SIGTERM:
            log_debug("Caught SIGTERM: Scheduling a shutdown");
            if (stopping == true) {
                log_error("Shutdown or reload already scheduled");
            }
            else {
                stopping = true;
                /* Ensure the controller knows a shutdown was requested. */
                kill(controller_pid, sig);
            }
            break;
        case SIGINT:
            log_debug("Caught SIGINT: Scheduling a shutdown");
            if (stopping == true) {
                log_error("Shutdown or reload already scheduled");
            }
            else {
                stopping = true;
                /* Ensure the controller knows a shutdown was requested. */
                kill(controller_pid, sig);
            }
            break;
        case SIGHUP:
            log_debug("Caught SIGHUP: Scheduling a reload");
            if (stopping == true) {
                log_error("Shutdown or reload already scheduled");
            }
            else {
                stopping = true;
                doreload = true;
            }
            break;
        case SIGUSR1:
            log_debug("Caught SIGUSR1: Reopening logs");
            doreopen = true;
            break;
        case SIGUSR2:
            log_debug("Caught SIGUSR2: Scheduling a custom signal");
            dosignal = true;
            break;
        default:
            log_debug("Caught unknown signal %d", sig);
            break;
    }
}