RE: [users@httpd] CGI help on apache needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx] 
Sent: Wednesday, July 05, 2006 11:23 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Re: [users@httpd] CGI help on apache needed

Joshua Slive wrote:
> On 7/5/06, Rajat Sharma <rsharma@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux