lag, to justify whether we received the kill -1 signal while( 1 ){ $job_flag = FALSE; //Job status flag print "Worker start running ... \n"; sleep(5); print "Worker''s task done ... \n"; $flag = TRUE; //Job status flag AutoStart( $signal_flag ); } function signal_handler( $signal ) { global $job_flag; global $signal_flag; switch( $signal ){ case SIGQUIT: print date(''y-m-d H:i:s'', time() ) . " Caught Signal : SIGQUIT - No : $signal \n"; exit(0); break; case SIGSTOP: print date(''y-m-d H:i:s'', time() ) . " Caught Signal : SIGSTOP - No : $signal \n"; break; case SIGHUP: print date(''y-m-d H:i:s'', time() ) . " Caught Signal : SIGHUP - No : $signal \n"; if( $flag === TRUE ){ AutoStart( TRUE ); }else{ $signal_flag = TRUE; } break; case SIGALRM: print date(''y-m-d H:i:s'', time() ) . " Caught