I am trying a http API that would fork a background script and immediately
return
I tried using fork() and setsid() or using Proc::Background
But the problem is my API hangs until the background script is complete
Is there a way I can avoid this
My code is here ( uses both fork and background .. neither works :-( )
#!/usr/bin/perl
#
#
use strict;
use CGI;
use Proc::Background;
$process = "/path/script"; #
print "Content-Type: text/plain\n\n";
$SIG{CHLD}='IGNORE';
my $pid = fork();
setsid();
print "STARTED\n";
exit if($pid);
my $proc1 = Proc::Background->new($process);
exit 0;
--
Thanks
Ram
<http://www.netcore.co.in/>
n <http://pragatee.com>