[pgsql@localhost tst]$ cat sig01.c #include <stdio.h> #include <signal.h> static void trapsigterm(int signum) { fprintf(stderr,"+++++++++++Got SIGTERM with %d ",signum); } static void trapsigquit(int signum) { fprintf(stderr,"+++++++++++Got SIGQUIT with %d ",signum); } int main() { signal(SIGTERM,trapsigterm); signal(SIGQUIT,trapsigquit); sleep(10); return 0; } [pgsql@localhost tst]$