EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Calling a Shell Script on ISeries

    Posted Thu March 12, 2015 11:00 AM

    Hi,

    I tried to call a Shell Script on the ISeries with

     

    syslib.setRemoteUser("***", "***");

    SysLib.callCmd("path.sh");

    But i got an error

    Fehler: com.ibm.as400.access.AS400SecurityException: Password is *NONE..

     

    Marcel-D


  • 2.  Re: Calling a Shell Script on ISeries

    Posted Thu March 12, 2015 05:21 PM

    Hi Marcel,

    Maybe try this:

    SysLib.callCmd("qsh cmd(path.sh)");

    You may also need to fully qualify the path unless the script is in the users home directory.

    Daron

    canutri


  • 3.  Re: Calling a Shell Script on ISeries

    Posted Fri March 13, 2015 03:38 AM

    Hi Daron,

    this doesn't work.

    SysLib.callCmd("qsh cmd(path.sh)");

    The path i'm calling is correctly ...

    I shortened the path for this example!

    I think I have to set an user and a password for the call, but "syslib.setRemoteUser" doesn't work for "callCmd".

     

    Kind regards

    Marcel-D


  • 4.  Re: Calling a Shell Script on ISeries

    Posted Fri March 13, 2015 06:49 AM

    Hi Marcel,

    Ah, I didn't pay close enough attention to your question and the sample code.  That should teach me not to post responses after a long day.

    After reviewing the documentation, I believe SysLib.callCmd would execute on the local machine; however, I could be wrong about that (it's now early in my work day and the coffee hasn't kicked in yet).

    I'm thinking that maybe coding a linkage part in the build descriptor mapped to QCMDEXC or your own custom program object on the IBM i which calls the shell script.

    Are you generating java project?  What is your server?

    canutri


  • 5.  Re: Calling a Shell Script on ISeries

    Posted Fri March 13, 2015 07:10 AM

    Hi Daron,

    we created a CL Program which we call from our java gen project.

    Thank you!

    Marcel-D


  • 6.  Re: Calling a Shell Script on ISeries

    Posted Fri March 13, 2015 07:23 AM

    Hi Marcel,

    Does the remote call to your CL Program seem like the right solution?

    Perhaps this topic from the RBD v9.1.1 documentation may be helpful.

    canutri


  • 7.  Re: Calling a Shell Script on ISeries

    Posted Fri March 13, 2015 09:41 AM

    Hi,

    it is not the best solution, but it works...


    Thank you!

    Marcel-D


  • 8.  Re: Calling a Shell Script on ISeries

    Posted Fri March 13, 2015 10:16 AM

    Hey..know you said you got it working...

    The use of syslib.callcmd does not use a remote call, so the setRemoteUser would not be used.  It is also not "controlled" by the linkage table.   It is essentially doing a JNI call to an executable on the system.   I would assume it should take on the authority of whatever userid the java is running on and look in its library list/path for the executable.

    I have not tried it specifically for a shell script on the ifs side of iSeries , so could be wrong, but I am pretty sure this is how it would work.

    Mark

    markevans