httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajat Sharma" <rsha...@airvana.com>
Subject RE: [users@httpd] CGI help on apache needed
Date Wed, 05 Jul 2006 15:54:57 GMT
Hi William,

STDOUT still remains under Apache's control.

When I invoke the CGI and tell it to redirect. It processes the request
but which remains in some kind of queue and waits until the subsequent
job ( which takes very long time to finish) completes. 

If I have my own daemon, say dameon.pl, which forks the process STDOUT
would still remain in apache's hand, and I guess it would still wait for
the job to finish.

Example.

Currently I have the following code

1. print ("Location: http://XYZ:9090/Project/filepath.html\n\n");
2. close(STDOUT);
3. my $pid = fork;
4. $pid = 0 unless defined $pid;   # be the kid if fork failed
5. exit 0 if $pid;
## child...
6. close(STDOUT);
### LONG DIRTY JOB START
7. exec "la_results.pl $input{'dirPath'} $checkboxString";
### LONG DIRTY JOB OVER
8. mail.pl $loginId ## MAIL THE NOTIFICATION


I modified the code so this script is put into another .pl. The print
outputs into the CONSOLE since apache does not handle it anymore.

It doesn't help :-(

Raj




-----Original Message-----
From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net] 
Sent: Wednesday, July 05, 2006 11:23 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] CGI help on apache needed

Joshua Slive wrote:
> On 7/5/06, Rajat Sharma <rsharma@airvana.com> wrote:
> 
>> My cgi script needs to do some dirty work. User is supposed to be 
>> notified
>> via email when the job is done.
> 
>> Issue is that the after submit of the page, the IE still keeps
loading 
>> the
>> page until the long\dirty job is over.
>>
>> How can I make line 1 come up as an instant page.
> 
> I've never done this myself, but I believe you need to close stdin and
> stderr as well as stdout.

I'm near certain that would lead to apache ultimately clobbering the
child
process.  The best way to handle this is your own daemon, which your cgi
tells to 'go' and then returns immediate to apache after printing the
status message.  Even if apache serves this request, I believe the
worker
slot will block on the process to exit, or axe it.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message