seaver has asked for the wisdom of the Perl Monks concerning the following question:
I have an external process that I want no control over once it's started running. Looking at exec() it sounds like the parent process actual exits once it's started exec(), is this true?
My problem lies in the fact that I have a web application that awaits a return value before loading a new page. The return value in itself is meaningless, but because it's XML-RPC, a return nevertheless is requested, especially as I'd like to see if the XML-RPC is working.
Thus I have this sub-function using a SOAP::Lite XML-RPC daemon:
Thankssub go{ shift if UNIVERSAL::isa($_[0] => __PACKAGE__); FORK: { if ($child = fork) { }elsif (defined $child) { my $exec = "/usr/local/bin/monster -i$id $filePath$file &"; qx/$exec/; }elsif ($! == EAGAIN) { sleep 5; redo FORK; }else { die "Can't fork: $!\n"; } } return 0; #just to say 'done'. }
Sam Seaver
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running external process WHILE exiting/returning
by pzbagel (Chaplain) on Jun 05, 2003 at 20:14 UTC | |
by seaver (Pilgrim) on Jun 05, 2003 at 21:29 UTC | |
|
Re: Running external process WHILE exiting/returning
by Missing Words (Scribe) on Jun 05, 2003 at 19:26 UTC |