Probably threading issues.
Most likely this one is the issue:
ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) REPLACE(*YES)
Or try to install and use the QSHEXEC command to run your curl stuff or analyze the QSHEXECC program and check the environment variables.
QShell on i
https://github.com/richardschoen/qshoni
Regards,
Richard Schoen
Web:
http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
------------------------------
message: 5
date: Thu, 2 Sep 2021 14:21:57 +1000
from: Don Brown via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
subject: curl works from strqsh but not from QSH
If I start qshell (STRQSH) I can run a command like;
/QOpenSys/pkgs/bin/curl -k -XPOST https://<address>:<port>gelf -d
''{"short_message": "|QSYS-QHST|CPF1124|Low|","full_message
<more_information_in_here> }'' ')
This runs successfully.
But if I try and run that from an RPG program like;
cmd = 'QSH CMD(''/QOpenSys/pkgs/bin/curl -k '
+ '-XPOST https:<address>:<port>/gelf -d
+ '''''{"short_message": "' + %trim(shortMessageZ1)
+ '"full_message":"' + %trim(fullMessageZ1) + '", '
+ '"host":"' + %trim(hostZ1) + '", '
+ '"version":"' + versionZ1 + '", '
+ '"timestamp":' + %char(msgTimeStampZ1)
+ %subst(msgTimeStampA: 20: 4) + ', '
+ '"level":' + %trim(levelZ1) + ' }'''''')';
cmdLen = %len(%trim(cmd));
callp(e) QCmdExc(Cmd:CmdLen);
I get error qsh: 001-0014 Command /QOpenSys/pkgs/bin/curl not found.
What am I missing ?
Thank you
Don
As an Amazon Associate we earn from qualifying purchases.