Re: Urgent help needed.
Posted in 2000
>Put the following in the first line of your shell scripts
>
>#!/bin/csh
>
>or whatever shell you want to run with.
>
>This tells the shell scripts which shell you wish to run with.
>
>
>Sean
>
No matter what command or command type we execute within SYSTEM (a
binary or a shell script [in which case we obviously have the #! first
line]) we get the behaviour described bellow (also we use full paths to
the command). Our command IS NOT the one producing the error. The
oninit that forks to exec the command seems to be execing the shell
described in the SHELL environment giving it the argument to the SYSTEM
command to run within the shell
xavier
Xavier Trevisani wrote:
> We just migrated from informix 5.10 to informix 9.20 (sun/solaris 2.6)
>
> We have encountered a problem that I am hoping someone has already
> solved. I did browse the archives and did not find an appropriate
> answer:
>
> We have a number of stored procedures that use the SYSTEM command to
> execute programs on the server (we are in a client/server configuration)
> These worked fine for all users under version 5.10, and no longer work
> for some users under version 9.20
>
> the users get the following error:
>
> 668: System command cannot be executed. 2: No such file or> directory
>
> We have found that the users that see this problem have their SHELL
> environment variable set without a path (SHELL=csh) or to a shell that
> does not exist in the server (i.e. SHELL=/usr/local/bin/zsh)
>
> If the user sets the SHELL variable to the full path of a shell that is
> also available in the server then they no longer get the error.
>
> (if tried many other approaces before finding this. Like executing a
> shell scrip or simple echo into mail commans, the shell itself ... but
> nothing made a difference. It looks like what the engine is doing is
> trying to execute $SHELL <arg_to_the_system_command>
>
> How can overcome this problem? Having the users change their SHELL
> variable is not really an option as it has concequences beyond the
> conection to the database server and use of our app and tools (the user
> accounts are not exclusively for usage of our app/tools)
>
> I don't understand why the engine would use the client's SHELL env
> variable to determine the shell to execute. Shouldn't that be a server
> configuration? Can it be overwritten on the server
>
> Any information or ideas greatly appreciated
>
> xavier