Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by edan (Curate)
on Dec 21, 2004 at 12:40 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://416442]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-16 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found