× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Peter,

Signal 6 is SIGTERM -- the "terminate" signal. This normally occurs when someone ends a job, either by using the Unix "kill" command, or running ENDJOB OPTION(*CNTRLD)

If nothing on your system is ending the job this way, then perhaps the software is ending itself? Sometimes programs detect a problem and raise a signal to terminate themselves.

As Kevin pointed out, using QP2SHELL is not reliable unless you spawn a new job and connect pipes to it to handle stdio descriptors. This is because QP2SHELL will run things in the same job, which is not how Unix code works -- Unix code would run each program in a separate process (the Unix equivalent of an IBM i job) and connect them with pipes.

If you try to run your program in the same job using the ILE C stdio support, it may or may not work, depending on whether the program is expecting multiple threads/jobs to be able to access the I/O simultaneously.

It has been known to cause all sorts of nasty hard to troubleshoot problems, though, so if you're in doubt, either spawn a job connected with pipes, or use the STRQSH/QSH command which will do that for you.

-SK


On 11/21/2016 12:29 PM, Peter Connell wrote:
Kevin,

I normally use QP2SHELL so that the process runs in the same job to prevent starting copious jobs when the process is repeated frequently.
QSH starts a new job for each process.

Peter


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Kevin Adler
Sent: Tuesday, 22 November 2016 6:23 AM
To: Midrange Systems Technical Discussion
Subject: Re: PASE for i ended for signal 6, error code 1.

I'd recommend using QSH for batch processing of Node.js applications.
QP2SHELL does not set up a proper environment, especially around file descriptors that can cause issues with Node.js applications.

For interactive applications, SSH (or in a pinch QP2TERM) is still the recommended environment.

"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 11/19/2016
06:00:51 PM:

From: Peter Connell <Peter.Connell@xxxxxxxxxx>
To: "MIDRANGE-L@xxxxxxxxxxxx" <MIDRANGE-L@xxxxxxxxxxxx>
Date: 11/19/2016 06:01 PM
Subject: PASE for i ended for signal 6, error code 1.
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>

I have a node.js script that runs fine when executed via the QSH
command.
But when executed via QP2SHELL or QP2SHELL2 it dies with the CPFB9C6
- PASE for i ended for signal 6, error code 1.

Here is the node.js script. It simply performs an HTTPS GET via a
forward proxy and writes the response to a flat file.

// ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) is required before
running this script to avoid signal 5.
// To run enter the following command QSH CMD('node /home/pjctest/
node/proxyTest2.js')

var request = require('/QOpenSys/QIBM/ProdData/Node/lib/
node_modules/npm/node_modules/request');
var fs = require('fs');
var outfile = '/tmp/proxyTest.txt';
var url = 'https://ewp.co.nz/admin/login';
var proxy = 'http://10.9.31.37:3128';
const args = process.argv;
console.log(args);
request( {'url': url, 'proxy': proxy }, function(error, response,
body) { fs.writeFile(outfile, body); } ).end();

From QSH the outfile is created OK

Here is the RPGLE to invoke QP2SHELL2
*inLR = *on;
pgmnam = '/QOpenSys/QIBM/ProdData/Node/bin/node';
cmd1 = '/home/pjctest/node/proxyTest2.js' + x'00';

C Call 'QP2SHELL2'
C Parm pgmnam 37
C Parm cmd1 33

return;

From RPGLE the outfile is not created and it dies with CPFB9C6.

I'm wondering if the script needs some closing code to end it.

Regards, Peter




##############################################################
This correspondence is for the named person's use only. It may contain
confidential or legally privileged information, or both. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this correspondence in error, please immediately delete
it from your system and notify the sender. You must not disclose, copy
or rely on any part of this correspondence if you are not the intended
recipient. Any views expressed in this message are those of the
individual sender, except where the sender expressly, and with
authority, states them to be the views of Veda. If you need
assistance, please contact Veda :- Australia
http://www.veda.com.au/contact-us New Zealand
http://www.veda.co.nz/contact-veda
##############################################################

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.


##############################################################
This correspondence is for the named person's use only. It may contain confidential or legally privileged information, or both. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this correspondence in error, please immediately delete it from your system and
notify the sender. You must not disclose, copy or rely on any part of this correspondence if you are not the intended recipient. Any views expressed in this message are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Veda. If you need assistance, please contact Veda :-
Australia http://www.veda.com.au/contact-us
New Zealand http://www.veda.co.nz/contact-veda
##############################################################


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.