Weird backtick problem

This is a discussion on Weird backtick problem within the Apache Web Server forums, part of the Web Server and Related Forums category; I'm installing TWiki on a server that I don't control, and I have boiled a bizarre problem down ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-06-2006
Peter Scott
 
Posts: n/a
Default Weird backtick problem

I'm installing TWiki on a server that I don't control, and I have boiled
a bizarre problem down to this: a (Perl) program that executes a command
in backticks will work in the cgi-bin directory, but hangs in the
htdocs/wiki/bin directory. The program is no longer than

print `/bin/ls`;

(after the content-type header) and it makes no difference what the
command in the `` is. If I put anything else besides backticks in the
program it executes properly. I have a .htaccess in the wiki/bin
directory with a SetHandler cgi-script directive. The cgi-bin directory
has no .htaccess file. htdocs is a sibling of cgi-bin. mod_perl is not
running.

I got nowhere with extensive googling. There were some postings alleging
a similar problem on Windows servers but this is Linux. As a last resort
I will have to figure out how to install TWiki by moving its programs to a
cgi-bin directory out of its main tree, but I'd still like to know what
the heck is going on here. The important thing to note is that programs
*are* working in the wiki/bin directory, except for when they employ
backticks; but programs using backticks *do* work in the cgi-bin
directory. I can even run a CGI program in cgi-bin that uses
backticks of its own to executes a program in wiki/bin that also contains
backticks, and *that* works.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  #2 (permalink)  
Old 10-06-2006
Peter Scott
 
Posts: n/a
Default Re: Weird backtick problem

On Fri, 06 Oct 2006 19:31:19 +0000, I wrote:
> a (Perl) program that executes a command
> in backticks will work in the cgi-bin directory, but hangs in the
> htdocs/wiki/bin directory.


Forgot to mention. This is Apache 1.3.37.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  #3 (permalink)  
Old 10-07-2006
Yamaska
 
Posts: n/a
Default Re: Weird backtick problem

Peter Scott wrote:
> On Fri, 06 Oct 2006 19:31:19 +0000, I wrote:
>> a (Perl) program that executes a command
>> in backticks will work in the cgi-bin directory, but hangs in the
>> htdocs/wiki/bin directory.

>
> Forgot to mention. This is Apache 1.3.37.
>

Not sure if I read your prob correctly, but how's about adding a script
alias for the wiki/bin.

You'll need to let apache know which dirs hold executables, otherwise
they won't work.

Hope this helps

Pete
  #4 (permalink)  
Old 10-08-2006
Peter Scott
 
Posts: n/a
Default Re: Weird backtick problem

On Sat, 07 Oct 2006 14:29:08 +0200, Yamaska wrote:

> Peter Scott wrote:
>> On Fri, 06 Oct 2006 19:31:19 +0000, I wrote:
>>> a (Perl) program that executes a command
>>> in backticks will work in the cgi-bin directory, but hangs in the
>>> htdocs/wiki/bin directory.

>
> Not sure if I read your prob correctly, but how's about adding a script
> alias for the wiki/bin.
>
> You'll need to let apache know which dirs hold executables, otherwise
> they won't work.


My .htaccess says

SetHandler cgi-script
Options +ExecCGI

I tried putting a ScriptAlias in there and got a 500, but I don't see the
point since it is just going to point to the same directory anyway.
Remember, the programs in this directory *do run* - they just can't
execute a command in backticks.

I experimented some more. The problem is with fork(): when executed in the
cgi-bin directory, it works. But in this directory, it returns undef,
with $! set to EAGAIN (resource temporarily unavailable), which explain
the hangs on backticks, 'cos it's just going to keep trying to fork. So I
don't even have to exec() anything to have the problem.

Did some more googling to no effect. This is not running under SSL. It
happens every time. I don't see how the system can have a different limit
depending on the directory. I've looked through httpd.conf and can't see
anything weird.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:12 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0