in reply to Re^2: how to kill background process when script exit?
in thread how to kill background process when script exit?
First,
$kid = open (FH, "java JavaApp 2> /dev/null & |");
should be
$kid = open (FH, "java JavaApp 2> /dev/null |");
It makes no sense to use "&" there. Removing it might even solve your problem. $kid would still refer to the shell, but killing the shell might kill its children too. Killing the negative of the shell's PID has an even greater chance of working. But why keep the shell around?
$kid = open (FH, "exec java JavaApp 2> /dev/null |");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how to kill background process when script exit?
by Allasso (Monk) on Feb 20, 2011 at 13:57 UTC | |
by ikegami (Patriarch) on Feb 20, 2011 at 21:25 UTC | |
by Allasso (Monk) on Feb 20, 2011 at 23:55 UTC | |
by ikegami (Patriarch) on Feb 21, 2011 at 01:05 UTC | |
|
Re^4: how to kill background process when script exit?
by Allasso (Monk) on Feb 21, 2011 at 18:04 UTC |