72 ## Place this first. 73 for my $sig ( keys(%SIG) ) 74 { 75 $EXIT++; 76 outmsg(' Processing handler: '.$sig.'('.$EXIT.')',1); 77 78 $SIG{$sig} = sub 79 { 80 outmsg('Caught signal: '.$sig.'...dying.',2,$EXIT); 81 }; 82 } 83 84 ## Then any specific handlers here...next. 85 $SIG{USR1} = sub 86 { 87 ## Make sure that the process is in a sleep state so that 88 ## we don't inadvertently interrupt a run cycle. 89 if ( $SLEEPING ) 90 { 91 outmsg(' CAUGHT USR1! -- pre-empting sleep '. 92 'schedule.',10); 93 _main(); 94 } 95 }; 96