Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Running an external script from a Perl CGI script

by BlueLines (Hermit)
on Feb 21, 2001 at 16:55 UTC ( [id://59913]=note: print w/replies, xml ) Need Help??


in reply to Running an external script from a Perl CGI script

1) I think it may be a path issue. Check the absoute pathname and try it again (ls is a shell builtin and requires no path).

2) Try calling the external script with system and check the return value. Then try calling it with backticks.

3) Try running something like this from the cgi:
foreach my $key (keys %ENVY) { print "$key: $ENV{$key}\n"; }

look at the output. Is there anything weird there that would screw with shell processes?

4) Also, make sure that there aren't any zombie processes of apache hanging on. If there are, try running the script and redirecting the output to /dev/null. I've had weird issues with apache zombying off httpd processes because a called cgi program forked off another shell for the process. Even though the process finished fine, the second process seemed to never let go of the shell (even though it did). We observed this at my workplace with a cgi that started mysql. The supplied mysql.server script seems to break Apache + mod_perl when you call it from a cgi. We finally solved the problem by calling mysql.server and redirecting STDERR and STDOUT to /dev/null.

BlueLines

Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://59913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-19 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found