Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Getting the pid of the process launched by my perl program

by edan (Curate)
on Dec 21, 2004 at 12:40 UTC ( #416442=note: print w/ replies, xml ) Need Help??


in reply to Getting the pid of the process launched by my perl program

$SIG{CHLD} = 'IGNORE'; # on systems where it's supported defined( my $pid = fork ) or die "fork: $!"; if ( $pid ) { # parent print "child pid is $pid\n"; } else { # child exec("a.out") or die "exec: $!"; }
--
edan


Comment on Re: Getting the pid of the process launched by my perl program
Download Code
Re^2: Getting the pid of the process launched by my perl program
by Anonymous Monk on Dec 22, 2004 at 11:05 UTC
    Thanx much edan and ozone !!
Re^2: Getting the pid of the process launched by my perl program
by Anonymous Monk on Apr 12, 2010 at 11:20 UTC
    I'm using the same logic to monitor the child process with a timer in the parent. On maximum timeout I'm killing the child process. The issue is I'm running an exe from the child which doesn't die on kill the child. I tried to explicitly kill the process with taskkill on windows and it works fine. But I face portability issues because of using taskkill. Can anybody help on this?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://416442]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2015-07-04 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls