Re: SPL behaving oddly
Posted in 2005
Topics: Stored Procedures & SPL, Server Administration, Platform-Specific Issues, Versions, Editions & End-of-Life, Jobs, Consulting & Announcements
malc_p@btinternet.com wrote:
> HP-UX 11i, IDS 9.30HC5
>
> Afternoon chaps
> We have an SPL which is failing to run here - it's a fairly simple one
> used to call a shell script when executed, code as follows:
>
> CREATE FUNCTION "dba".request_proj(env CHAR(5),user CHAR(12), pref INT,
> cref INT
> )
>
> RETURNING INT;
>
>
>
> DEFINE path CHAR(50);
>
> DEFINE error_num INT;
>
> DEFINE error_val INT;
>
>
>
> ON EXCEPTION
>
> SET error_num,error_val
>
> END EXCEPTION WITH RESUME
>
>
> LET error_val = 0;
>
>
> LET path =
> '/opt/'||TRIM(env)||'/progs/general/interfaces/proj_request/'
> ;
>
>
> SYSTEM TRIM(path)||'proj_request.sh ' ||TRIM(env)||' '||user||'
> '||
> pref||' '||cref;
>
>
> RETURN error_val;
>
>
> END FUNCTION;
>
> .... and it's failing with a return code of -2, and the following is
> put into the IDS message log:
>
> 11:26:09 execve() of " -c
> /opt/ROBIN/progs/general/interfaces/proj_request/proj_request.sh ROBIN> inetuser 290 1002678" failed errno=2
>
> This is palpably rubbish - the -2 error is "No such file or directory"
> but the file is there - I've even set the access perms on it and it's
> path to 777.
> Does anyone know what execve() is doing?
> Anyone seen this before?
It looks like a SHELL problem. What is your default shell?
It almost looks as if it is looking for a file called
"/opt/ROBIN/progs/general/interfaces/proj_request/proj_request.sh ROBIN
inetuser 290 1002678". As if the command and all parameters has somehow
been wrapped in quotes.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.2/138 - Release Date: 17/10/2005
sending to informix-list
Mark D. Stock wrote:
> malc_p@btinternet.com wrote:
>
>>HP-UX 11i, IDS 9.30HC5
>>
>>Afternoon chaps
>>We have an SPL which is failing to run here - it's a fairly simple one
>>used to call a shell script when executed, code as follows:
>>
>>CREATE FUNCTION "dba".request_proj(env CHAR(5),user CHAR(12), pref INT,
>>cref INT
>> )
>>
>> RETURNING INT;
>>
>>
>>
>>DEFINE path CHAR(50);
>>
>>DEFINE error_num INT;
>>
>>DEFINE error_val INT;
>>
>>
>>
>> ON EXCEPTION
>>
>> SET error_num,error_val
>>
>> END EXCEPTION WITH RESUME
>>
>>
>> LET error_val = 0;
>>
>>
>> LET path =
>>'/opt/'||TRIM(env)||'/progs/general/interfaces/proj_request/'
>>;
>>
>>
>> SYSTEM TRIM(path)||'proj_request.sh ' ||TRIM(env)||' '||user||'
>>'||
>> pref||' '||cref;
>>
>>
>> RETURN error_val;
>>
>>
>>END FUNCTION;
>>
>>.... and it's failing with a return code of -2, and the following is
>>put into the IDS message log:
>>
>>11:26:09 execve() of " -c
>>/opt/ROBIN/progs/general/interfaces/proj_request/proj_request.sh ROBIN>>inetuser 290 1002678" failed errno=2
>>
>>This is palpably rubbish - the -2 error is "No such file or directory"
>>but the file is there - I've even set the access perms on it and it's
>>path to 777.
>>Does anyone know what execve() is doing?
>>Anyone seen this before?
>
>
> It looks like a SHELL problem. What is your default shell?
Empty -- the file that's not there is '-c' because that appears after
the double quote on the timestamped line and before the /opt/ROBIN/...
file name that palpably is present.
Investigate the environment of the server when it is started. There's
at least a medium chance that $SHELL is unset, or is set to blank.
> It almost looks as if it is looking for a file called
> "/opt/ROBIN/progs/general/interfaces/proj_request/proj_request.sh ROBIN
> inetuser 290 1002678". As if the command and all parameters has somehow
> been wrapped in quotes.
I thought that for a few moments, then looked at the whole message.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/