Keeper has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to have a cgi script execute a command on a remote server and send it to the background ( running security scans ). The browser waits for more data to come and times out, thus killing the scripts. Any Advice? A snippet of the script I am trying to write
print PLEXE "system(\"/home/****/Share/ghostck.pl &\");\n"; close(PLEXE); $sftp->put($PLEXE, $REMPLEXE); $ssh->cmd("chmod 755 $REMOTERTR"); $ssh->cmd("chmod 755 $REMPLEXE"); $ssh->cmd("perl $REMPLEXE");

Replies are listed 'Best First'.
Re: CGI Timeout
by Corion (Patriarch) on Nov 03, 2008 at 18:59 UTC

    As you were told in the CB already, look at Watching Long Processes Through CGI, which demonstrates, among other things, the techniques to dissociate a child from its parent by closing all relevant handles.

      Yea the CB has been pretty useful, I've been using the site as a reference encyclopedia for sometime, hopefully I can start participating now.