Aaron,
Is your shell redirecting its output?
I thought I read that a new STDIN, STDOUT, and STDERR get created for
each shell that does a redirect and that STDOUT needs to be redirected
prior to running QSHELL.
Something like:
CRTPF (QTEMP/STDOUT)
OVRDBF(STDOUT) TOFILE(QTEMP/STDOUT)
QP2SHELL(SomeShell)
DLTOVR (STDOUT)
Then you return your html to the browser.
I was thinking that if the shell is redirecting output to a file or
print that it might not be releasing STDOUT when it is finished. If the
shell does redirect output I would guess that the html that is supposed
to go to the browser is being written to the same place your shell
directs its output.
Another thing to check is if the environment variable
QIBM_USE_DESCRIPTOR_STDIO is set to 'Y'. I would imagine it already is,
but might be worth looking into.
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Aaron Bartell
Sent: Monday, November 26, 2007 7:39 AM
To: 'Web Enabling the AS400 / iSeries'
Subject: [WEB400] QP2SHELL "taking over" standard output
Hi all,
Have an interesting one today. I am using the QP2SHELL API to run a
shell
command from an RPG CGI app, and it appears as though it is affecting my
ability to send a response to standard output that makes it back to the
client (PC app).
When I debug the program it executes everything just fine including
sending
a simple response of Content-type: text/plain plus two crlf's and a
single
text line stating success. But the client application receives a 500
error
from Apache. I have experienced the 500 error in cases when there
wasn't a
response sent back, and I am thinking that is what's happening here.
So my theory is that standard output is being redirected with my call to
QP2SHELL to someplace else - where it is going, I have no idea.
Can anybody shed some light on this for me? Is there a way to re-route
standard out to point at Apache again? I thought I saw somebody doing
an
OVRxxx type command in a CL a long time ago that addressed this, but
haven't
been able to find it in the archives.
Thanks,
Aaron Bartell
http://mowyourlawn.com
As an Amazon Associate we earn from qualifying purchases.