예제 #1
0
/* when we catch a signal and want to exit we call this function
   to do it gracefully */
static void mk_signal_exit()
{
    /* ignore future signals to properly handle the cleanup */
    signal(SIGTERM, SIG_IGN);
    signal(SIGINT,  SIG_IGN);
    signal(SIGHUP,  SIG_IGN);

    mk_exit_all();

    mk_info("Exiting... >:(");
    _exit(EXIT_SUCCESS);
}
예제 #2
0
파일: mk_signals.c 프로젝트: Doeme/monkey
/* when we catch a signal and want to exit we call this function
   to do it gracefully */
static void mk_signal_exit()
{
    /* ignore future signals to properly handle the cleanup */
    signal(SIGTERM, SIG_IGN);
    signal(SIGINT,  SIG_IGN);
    signal(SIGHUP,  SIG_IGN);

    mk_user_undo_uidgid();
    mk_utils_remove_pid(mk_config->path_conf_pidfile);
    mk_exit_all();

    mk_info("Exiting... >:(");
    _exit(EXIT_SUCCESS);
}