RE: Submitting jobs remotely over CGI, closing file handles etc

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

 



Hi
 
Thanks for the reply.  When I mention that the cgi script "doesn't work", well, it does actually work in that it runs the job and everything is fine - except on my old server, the cgi script starts the job, and exits immediately after informing the user;  on the new server, the cgi script waits until the job has completed before exiting, so my users get the experience of a web-page taking a really long time to load.
 
I'm pretty sure there is just an open handle, probably in one of the modules I mentioned below, I just need to find it :)
 
Thanks
Michael


From: Patrick Horgan [mailto:phorgan1@xxxxxxxxx]
Sent: 19 June 2008 18:14
To: users@xxxxxxxxxxxxxxxx; michael watson (IAH-C)
Subject: Re: Submitting jobs remotely over CGI, closing file handles etc

michael watson (IAH-C) wrote:
OK, so no answers from this then... Instead, can anyone tell me how I
can monitor whether (and which) file handles are open whilst the CGI
script is running? 
  
lsof -unameofuserrunningcgiscript

for example on my machine apache runs as www-data, so I'd type lsof -uwww-data
Please read the man page for more information, for example, if the cgi script is short lived, you might want to put lsof in repeat mode with no delay redirected to a log file, and then kill it after the script finishes to find out if you caught it;)

In general, I'd add side effects into your script to allow you to follow it's progress--I assume you've already checked all the logs and there's nothing in there to tell you what went wrong.  i.e. does the cgi access show up in your access log?  You mention only that it doesn't work on the new server, but don't mention what message you get.  For example if I try to access a script that my server doesn't have read access to, the server returns a page that says " Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0" and then tells me the name of the file it couldn't open.  Unless you tell us more about how it fails, it's hard to help.

Patrick
-----Original Message-----
From: michael watson (IAH-C) [mailto:michael.watson@xxxxxxxxxxx] 
Sent: 16 June 2008 09:42
To: users@xxxxxxxxxxxxxxxx
Subject:  Submitting jobs remotely over CGI, closing file
handles etc

Dear All

I solved this problem some years ago by writing to this list and
carrying out the suggestions.  Oddly, I now have it again.

I am running two servers - an old one, running SuSe 8.2 and apache
1.3.28, and a relatively new one running Red Hat EL 4 and Apache 2.2.4.

Here's the thing - the same script WORKS on the old server, and not on
the new, and I don't know why.

The problem is an age old one - I have jobs that take hours, I want
users to submit these jobs over CGI, I want the cgi script to submit a
job "in the background", tell the user they'll be e-mailed the results,
and then exit after submitting the job.

This happens on my old server;  it doesn't on my new one.  Same script,
same data, same everything apart from the OS and apache version.

The solution I got many years ago was to make sure all my file handles
are closed - they are.

CGI.pm version on old server is: 2.8.1
CGI.pm version on new server is: 3.2.9

Mail::Sender.pm version on old server is 0.8.10
Mail::Sender.pm version on new server is 0.8.13

Perl version on old is 5.8.0
Perl version on new is 5.8.5

Any help would be appreciated!

Thanks

Michael

The information contained in this message may be confidential or legally
privileged and is intended solely for the addressee. If you have
received this message in error please delete it & notify the originator
immediately.
Unauthorised use, disclosure, copying or alteration of this message is
forbidden & may be unlawful. 
The contents of this e-mail are the views of the sender and do not
necessarily represent the views of the Institute. 
This email and associated attachments has been checked locally for
viruses but we can accept no responsibility once it has left our
systems.
Communications on Institute computers are monitored to secure the
effective operation of the systems and for other lawful purposes. 

---------------------------------------------------------------------
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