CGI Problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CGI Problem

George.Ferizis
Hi All,

I'm trying to run some Perl scripts using the CGI servlet and Jetty. The
scripts work fine when I set up a webapplication and then setup the
servlet in the web-jetty.xml file. However in order to use HTAccess, I
set them up under a context [can you get HTAccess with a
webapplication?]. Now the scripts fail whenever they execute a system
command with redirected output.

For example:

system "script.pl >> file.log" will fail, return 65280.

If #! is examined we find the error "No such file or directory".

Now in both the script being called by the system command and the
original script containing the system command, it is possible to open
the file and append to it using standard write commands: it's definitely
not file permissions. I'm thinking that this could perhaps be Jetty
opening up a new STDOUT, or STDERR file descriptor and closing the
original. Could anybody comment on this or any other possible reasons
that this may be happening?

Regards
- George Ferizis


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: CGI Problem

Heiner Westphal
George,

this looks like a cwd problem to me.
Could you try to use an absolute path like /tmp/file.log
instead of just file.log and retry?

The current working directory is probably not, what you think it
is. Try "system /bin/pwd" to see where you are.

HTH,

Heiner


[hidden email] wrote:

> Hi All,
>
> I'm trying to run some Perl scripts using the CGI servlet and Jetty. The
> scripts work fine when I set up a webapplication and then setup the
> servlet in the web-jetty.xml file. However in order to use HTAccess, I
> set them up under a context [can you get HTAccess with a
> webapplication?]. Now the scripts fail whenever they execute a system
> command with redirected output.
>
> For example:
>
> system "script.pl >> file.log" will fail, return 65280.
>
> If #! is examined we find the error "No such file or directory".
>
> Now in both the script being called by the system command and the
> original script containing the system command, it is possible to open
> the file and append to it using standard write commands: it's definitely
> not file permissions. I'm thinking that this could perhaps be Jetty
> opening up a new STDOUT, or STDERR file descriptor and closing the
> original. Could anybody comment on this or any other possible reasons
> that this may be happening?
>
> Regards
> - George Ferizis
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: CGI Problem

George.Ferizis
Heiner Westphal <susp48 <at> verit.de> writes:

>
> George,
>
> this looks like a cwd problem to me.
> Could you try to use an absolute path like /tmp/file.log
> instead of just file.log and retry?
>
> The current working directory is probably not, what you think it
> is. Try "system /bin/pwd" to see where you are.
>
> HTH,
>
> Heiner
>

Heiner,

Thankyou for your response. I should probably have been more
specific with that part in my post - both the executable
and the log file are called using absolute paths.

I would try "system /bin/pwd", but I have no way (that I can
think of) of getting the output: any redirect doesn't work.

To assert my certainty about the current working directory,
the perl script being run and the log file are in the same
directory. The script does run correctly when called alone.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support