What happens to a SIGINT (^C) when sent to a perl script containing children?

Posted by CmdrGuard on Stack Overflow See other posts from Stack Overflow or by CmdrGuard
Published on 2011-01-17T19:42:06Z Indexed on 2011/01/17 19:53 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

I have a Perl script that forks.

Each fork runs an external program, parses the output, and converts the output to a Storable file.

The Storable files are then read in by the parent and the total data from each of the children are analyzed before proceeding onto a repeat of the previous fork or else the parent stops.

What exactly happens when I issue a ^C while some of the children are still running the external program? The parent perl script was called in the foreground and, I presume, remained in the foreground despite the forking.

Is the SIGINT passed to all children, that is, the parent, the parent's children, and the external program called by the children??

© Stack Overflow or respective owner

Related posts about perl

Related posts about parent-child