473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange behaviour with perl and apache

Hi

I have some troubles with a long system() sub-process (from 30 sec to
30 min) called from a CGI.

My web page have to wait the end of the system() call before finishing
it's loadding but this is not whats appen. The web page is waiting for
a couple of minutes but continue and finish it's loadding before the
end of program called by the system() call

Here a part of my "pseudo" code :

^- other code (html stuff)...

if (!is_lock($file _name, $file_date)){
lock($file_name , $file_date)
system "path_to_long_e xecution_prog $file_name $file_date";
my $exit_value = wait();
unlock($file_na me, $file_date)
} else {
log("Error :: Trying to redo the system call ?!?");
}

and yes, I got "Error :: Trying to redo the system call ?!?" in my log
and is not suppose to... and I don't know why !

I run on a AIX server whith apache 1.3.27 and perl 5.005_02

Dave
Jul 19 '05 #1
1 2355
In article <7c************ *************@p osting.google.c om>, David
Cantin <da******@ca.ib m.com> wrote:
Hi

I have some troubles with a long system() sub-process (from 30 sec to
30 min) called from a CGI.

My web page have to wait the end of the system() call before finishing
it's loadding but this is not whats appen. The web page is waiting for
a couple of minutes but continue and finish it's loadding before the
end of program called by the system() call
You don't need to do a wait() after a call to system(). The system()
call does a fork, an exec, and a wait in the parent process to wait for
the child process before returning to your main program. You should
also check the return from system() to see if an error occurred (see
below).
Here a part of my "pseudo" code :
It is better to post real code. Write a short perl program that calls
the same program and see what happens when you execute the perl program
from the command line (you may have to supply some things normally
supplied by your web server). Then post the program and the results if
you still get an error you can't diagnose.

^- other code (html stuff)...

if (!is_lock($file _name, $file_date)){
lock($file_name , $file_date)
system "path_to_long_e xecution_prog $file_name $file_date";
Replace above line with:

system "path..." == 0 or die "system failed: $?";
my $exit_value = wait(); Delete the above line.
unlock($file_na me, $file_date)
} else {
log("Error :: Trying to redo the system call ?!?");
}

and yes, I got "Error :: Trying to redo the system call ?!?" in my log
and is not suppose to... and I don't know why !

I run on a AIX server whith apache 1.3.27 and perl 5.005_02

Dave


FYI: this newsgroup is defunct. Try comp.lang.perl. misc in the future
for better responses.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2395
by: Keith | last post by:
All: What is the difference between Perl (CGI) and PHP (Apache module)? I thought both used servers to direct the user to the appropiate Perl or PHP program in order to execute the program to interpret the user's Perl or PHP script respectively. Keith
4
6057
by: Torsten Reiners | last post by:
Hi, it might be a simple solution but I do not see it. The problem is that I have the following file stored on my local harddrive. All references are URL to a remote computer. It is working, i.e. the code is not throwing an error (btw the field should link to other pages by clicking them). The strange behavior is, that I copy the file to...
6
3948
by: Michael L. Artz | last post by:
I'm having some odd issues, but I'm not sure exactly the cause of them, but postgres is the component in the system that is throwing the errors, so I thought I'd start here. I have built a web application that uses postgres (7.3.2) as its backend, with the front being an Apache2/mod_perl solution. I've printed what I think the relevant...
12
2330
by: rurpy | last post by:
Is there an effcient way (more so than cgi) of using Python with Microsoft IIS? Something equivalent to Perl-ISAPI?
7
2083
by: Tim Evers | last post by:
Hi, though I'm some kind of experienced bug-hunter :) I have no idea what happens in the following case: linux system, apache w. suexec, perl, graphviz (2.8). A perl script calls the graphviz binary. This works perfectly in a console but fails with a segfault when called under Apache/mod_cgi/perl regardsless of suexec beeing active or...
1
2735
by: graphman | last post by:
I have a perl script that I'm calling using php's shell_exec that uses an expect module to go to another system to pull tiff files. The php perl combination works great when I launch from the commandline: $php docpull.php I get the files I want. Everything is perfect. When I run docpull.php through the web server I get to the expect...
31
5696
by: happyse27 | last post by:
Hi All, I am doing a connection to database from perl to mysql via apache. Apache is configured correctly. Mysql username is root and password is mysql1, and database name is test. when I type in url 127.0.0.1/cgi-bin/dbconn.pl, it showed internal server error 500. And errors in apache section a) below and errors in access. The...
10
6945
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114....
17
5923
by: kanishka1213 | last post by:
when i run perl script in the cmd prompt , it runs well and outputs results from db. but when i run the same script on apache server internet explorer. i get an error as ----- install_driver(Oracle) failed: Can't load 'C:/perl/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified module could not be found at...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.