Re: Howto catch a signal and continue afterwards



C.DeRykus wrote:

On Feb 15, 11:59 am, matthias.me...@xxxxxx (Matthias Meyer) wrote:
Hi group,

I try to catch a signal, write out some statistics about my running
perl program and continue afterwards with the program.

use strict;
no  utf8;
use MyProgram::Lib;
use Encode;
use Socket;
use File::Path;
use File::Find;
use Getopt::Std;
die("MyProgram::Lib->new failed\n") if ( !(my $init =
MyProgram::Lib->init) ); $SIG{ILL} = \&write_status;
:
sub write_status
{
my $sigName = shift;

print( STDERR "Signal ILL catched" );
return;}

Within bash I send the signal with "kill -4 <procID>"
Unfortunately my program die after catching the signal.
Without the print it dies too.
Also within debugger (perl -d:ptkdb) it dies after the return statement.

Is it possible to interrupt a perl program and continue afterwards?

Most signals can be caught and programs can continue. However SIGILL
by default causes program termination and can't be ignored. Core
dumps
are often generated.

Any END {} blocks still execute though.

--
Charles DeRykus


SIGIO work.
Thanks
Matthias
--
Don't Panic

.



Relevant Pages

  • Re: Howto catch a signal and continue afterwards
    ... Also within debugger it dies after the return statement. ... Is it possible to interrupt a perl program and continue afterwards? ... Most signals can be caught and programs can continue. ...
    (perl.beginners)
  • Re: Howto catch a signal and continue afterwards
    ... Also within debugger it dies after the return statement. ... Is it possible to interrupt a perl program and continue afterwards? ... You have to redo the command until it ...
    (perl.beginners)
  • Re: ls hung
    ... sigpend = 0x00000103,0x00000000 ... Why ls doesn't dies? ... Signals can only affect processes when they are executing in user ... Then it must have something to do with the NFS server or the NFS client. ...
    (comp.unix.solaris)
  • Howto catch a signal and continue afterwards
    ... no utf8; ... Also within debugger it dies after the return statement. ... Is it possible to interrupt a perl program and continue afterwards? ...
    (perl.beginners)
  • Re: ls hung
    ... sigpend = 0x00000103,0x00000000 ... Why ls doesn't dies? ... Signals can only affect processes when they are executing in user ... any sugestion about how to kill this process? ...
    (comp.unix.solaris)