#include #include #include static void sig_hdl(int signo){ printf("catched \n"); getchar(); signal(SIGINT, SIG_DEF); } int main(){ signal(SIGTERM, sig_hdl); // signal(SIGKILL, sig_hdl); it is impossible to catch SIGKILL !! signal(SIGINT, sig_hdl); //etc... while(1){ } return 0; }