Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - slinger exec cmd can not find directory: (2 Items)
   
slinger exec cmd can not find directory  
Hi, I have come across some strange problem when use slinger web server.
I use:
export HTTPD_ROOT_DOC=index.shtml
export HTTPD_ROOT_DIR=/fs/flash/httpd/web
export HTTPD_SCRIPTALIAS=/fs/flash/httpd/cgi-bin
slinger -e -s &
to start web server

I have index.shtml in =/fs/flash/httpd/web
and a binary called webtest in =/fs/flash/httpd/cgi-bin
everything seems fine till now, I can visit index.shtml as default.

in the index.shtml
if  I code as:
<!--#exec cgi="webtest "  -->
it will display the result as I expected, however it could not handle even a extra space <!--#exec cgi="webtest  "  --> 
will not display anything.

when I change the code to
<!--#exec cmd=webtest"  -->
then there is nothing come out
but it will work if <!--#exec cmd=fs/flash/httpd/cgi-bin/webtest"  -->

I am quite strange it is can not find the default directory.

so I have do another test
    PATH:
    <!--#echo var="PATH" --> <BR>
    SERVER_ROOT:
    <!--#echo var="SERVER_ROOT" --> <BR>
    SERVER_SOFTWARE:
    <!--#echo var="SERVER_SOFTWARE" --> <BR>
    HTTPD_ROOT_DOC:
    <!--#echo var=" HTTPD_ROOT_DOC" --> <BR>
    HTTPD_SCRIPTALIAS:
    <!--#echo var="HTTPD_SCRIPTALIAS" --> <BR>
    HTTPD_ROOT_DIR:
    <!--#echo var="HTTPD_ROOT_DIR"--> <BR>
however 
HTTPD_ROOT_DOC & HTTPD_SCRIPTALIAS & HTTPD_ROOT_DIR 
can not display at all.

Another Question is:
slinger seems can not accept the soft link as it is env path.
for example
ln -sP /fs/flash/httpd/web /usr/web
export HTTPD_ROOT_DIR=/usr/web
slinger -e -s &
when I start the we, slinger will crash

Re: slinger exec cmd can not find directory  
Hi,

I've recently played with slinger and stumbled upon your post, so thought I'd try respond. Please see inline...

> if  I code as:
> <!--#exec cgi="webtest "  -->
> it will display the result as I expected, however it could not handle even a 
> extra space <!--#exec cgi="webtest  "  --> will not display anything.

I'm happy you figured that out. I suspect slinger tried to execute a cgi which actually has a space in its name, and 
this should be expected.

> when I change the code to
> <!--#exec cmd=webtest"  -->
> then there is nothing come out
> but it will work if <!--#exec cmd=fs/flash/httpd/cgi-bin/webtest"  -->
> 
> I am quite strange it is can not find the default directory.

I believe the syntax requires matching quotation marks. Will it work if you add the corresponding opening quote?  I.e. 
if you use <!--#exec cmd="webtest"  --> instead. 

> so I have do another test
>     PATH:
>     <!--#echo var="PATH" --> <BR>
>     SERVER_ROOT:
>     <!--#echo var="SERVER_ROOT" --> <BR>
>     SERVER_SOFTWARE:
>     <!--#echo var="SERVER_SOFTWARE" --> <BR>
>     HTTPD_ROOT_DOC:
>     <!--#echo var=" HTTPD_ROOT_DOC" --> <BR>
>     HTTPD_SCRIPTALIAS:
>     <!--#echo var="HTTPD_SCRIPTALIAS" --> <BR>
>     HTTPD_ROOT_DIR:
>     <!--#echo var="HTTPD_ROOT_DIR"--> <BR>
> however 
> HTTPD_ROOT_DOC & HTTPD_SCRIPTALIAS & HTTPD_ROOT_DIR 
> can not display at all.

I believe that's expected, please see the documentation for which env vars are available:
http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/s/slinger.html#CGIenvars

> Another Question is:
> slinger seems can not accept the soft link as it is env path.
> for example
> ln -sP /fs/flash/httpd/web /usr/web
> export HTTPD_ROOT_DIR=/usr/web
> slinger -e -s &
> when I start the we, slinger will crash
> 

That's strange, slinger didn't crash for me when using a symbolic link for root dir. I used a regular file system though
, not flash. Can you describe exactly what you did please?

Cheers!
/P