NAME
App::Chart::Proc::ChildPid -- child subprocess pid object
SYNOPSIS
use App::Chart::Proc::ChildPid;
my $cp = App::Chart::Proc::ChildPid->new ($pid);
$cp->kill_and_wait;
DESCRIPTION
App::Chart::Proc::ChildPid keeps hold of a process ID which is a child of the current process. If the ChildPid object is destroyed the child is killed and waited, thus protecting against creation of zombies.
FUNCTIONS
App::Chart::Proc::ChildPid->new ($pid)-
Create and return a new ChildPid holding process ID
$pid. There's no check that$pidis actually a child of the current process. $cp->kill ()$cp->kill ($sig)-
Do a
killon the child process, sending itSIGTERMor the given signal$sig(a signal name or number). The return is as per the corekillfunction, ie. 1 if successful, or 0 if no processes signalled (because the child has been waited). $cp->wait()-
Do a
waiton the child process and return its exit status. If the child has already been waited the return is -1 with$!set toECHILD(no such child). $cp->kill_and_wait()-
Do a
killandwaitcombination on the child process and return its exit status. ASIGTERMis sent first, and if that doesn't kill the process after a few seconds aSIGKILLis sent (which it can't ignore).If the child has already been waited the return is -1 with
$!set toECHILD(no such child).