Informix

 View Only
  • 1.  Setting "HOME" directory for client when using SYSTEM command

    Posted Mon June 28, 2021 04:49 AM

    Greetings,

    Encountering an interesting issue.
    Server is: 12.10.FC12

    When invoking an SPL procedure from a remote client which calls the routine:

    create procedure system_test()
        system 'echo "Hello"';
    end procedure;
    I get the following error:
    SQL error = -668 ISAM error = 0 error string = = ""
    It doesn't really matter what command I invoke via SYSTEM, I always get the same error.

    This only occurs when I invoke the above when connecting "remotely", either via JDBC or the native Informix driver.

    However, when I jump onto the server, logging in as the same user, and run the same proc inside a dbaccess session it works fine.

    So, when I traced the ADM VP, I noticed that it was doing a chdir() to what appears to be the HOME directory when SYSTEM is called "locally":
    [pid 3095] chdir("/home/informix") = 0
    However, when the client calls SYSTEM remotely, it fails because it tries changing to the directory the client is executed/run from:
    [pid 3128] chdir("C:\\Some\\Windows\\Directory\\Informix\\Client") = -1 ENOENT (No such file or directory)

    I'm not sure if this is a "feature" on Linux, or whether I haven't provisioned the Informix server correctly to use an appropriate "chdir()" directory.

    I have tried creating the same Windows directory on the server, however, it's not an absolute Linux path, so not sure where the directory should actually be placed (I might experiment...).

    Any ideas would be greatly appreciated.

    TIA.

    #Informix


  • 2.  RE: Setting "HOME" directory for client when using SYSTEM command

    Posted Tue June 29, 2021 03:05 AM
    Hi Daniil.

    This is the start of a work-around:

    https://www.ibm.com/docs/en/informix-servers/12.10?topic=statements-create-user-statement-unix-linux

    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------



  • 3.  RE: Setting "HOME" directory for client when using SYSTEM command

    Posted Wed June 30, 2021 12:16 AM
    Thanks Doug.

    I did have a little play. Unfortunately, it looks like I need USERMAPPING enabled. However, AFAIK, we don't use this feature in our production and acceptance-testing environments, but, SYSTEM calls seem to work fine on those.

    FWIW, this is occurring on an x86/Linux server install of Informix. The other environments are SPARC/Solaris.


  • 4.  RE: Setting "HOME" directory for client when using SYSTEM command

    Posted Wed June 30, 2021 01:53 AM
    You can enable USERMAPPING without restarting IDS. It's covered in this article:

    https://www.oninitgroup.com/faq-items/informix-read-only-access

    Your problem may be a defect, though. Have you opened a support case? Are your Solaris systems on a different IDS version?

    Also, strange results occur after starting IDS when in a directory which is then removed. Have you tried stopping and restarting?

    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------



  • 5.  RE: Setting "HOME" directory for client when using SYSTEM command

    Posted Thu July 01, 2021 04:23 AM
    Thanks Doug.

    We've got a work-around which requires oninit be started from a specific well-known directory (which is never removed). Although, the observation of strange behaviour from a deleted start directory is most curious.

    Due to the work-around, we're unlikely to raise a support ticket.
    The Solaris servers are all running 12.10.FC10, with one at 12.10.FC12.

    Unfortunately, starting and stopping doesn't appear to affect behaviour.