in reply to Re: Signal to parent-process. Does it affect it's children?
in thread Signal to parent-process. Does it affect it's children?

Hmmmm. I might be confused with functions being re-entrant and un-buffered I/O.

What happens in my process is that I'm not having any waitpid but instead polling to check if a new line has been printed on the stream.
Let me put the exact code since this might be something specific:

$selector = IO::Select->new(); $selector->add(*CMD_ERR, *CMD_OUT); while(@ready = $selector->can_read) { foreach my $fh (@ready) { if(fileno($fh) == fileno(CMD_ERR)) { my $line = scalar <CMD_ERR>; print $line; } } }

Basically if what your meaning by unbuffered is having lines on the stream which is not printed when the signal occur, then yes I very likely have.

UPDATE: I've tried this on two systems. Opensolaris and SLC4, both 32 bit. My perl version is: v5.8.4

Replies are listed 'Best First'.
Re^3: Signal to parent-process. Does it affect it's children?
by Perlbotics (Archbishop) on Sep 08, 2008 at 21:33 UTC
    Hi, maybe this is a stupid question but, how do you send the kill signal? E.g. kill -10 1234 sends the SIGUSR1 signal to process 1234 while kill -10 -1234 sends the signal to the whole process group (process 1234 plus its child processes). Just a thought...
      Good comment!

      I use kill -s HUP <pid> from the shell.
      I've also tried to do this from a unaffected script with:
       kill "USR1", <pid>
      So unless there are something I don't see here, Its not the problem :/
        Why not kill -s USR1 <pid>? In your example, you only specified a handler for USR1, not HUP...