|Welcome to the Monastery|
Child process lingers after keyboard interrupt on Windowsby toughy (Initiate)
|on Oct 10, 2018 at 23:01 UTC||Need Help??|
toughy has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to make a script to automate our project build process and I run into a surprising issue:
With either of open('-|'), IPC::Open3 or IPC::Cmd::run, the child process lingers still alive after a keyboard interrupt (^C) or a timeout alarm from IPC::Cmd. The main script receives the signal and exits as expected, but the build process is still running in the background and visible in Task Manager window.
Contrast this with a call to system() which does The Right Thing: keyboard interrupt will stop the child process, and only after that will the parent process by interrupted.
Can I fix this somehow please ?
I would like to run a couple of my build commands in parallel, and ensure they always terminate before the main script, especially in case of errors, abort, interrupt, other signals like TERM, HUP, QUIT...
Is this possible please ?
Issue not present on Linux or with perl6 Proc class