× 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.



The environment variable you have added will only affect the job in which you add it. The submitted job needs to add it (not add it then submit the job).

-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Kelly Cookson
Sent: 21 August 2015 19:08
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Starting a node program so it keeps running without interactive jobs staying open.

I'm almost there--I think.

I executed the following command in CL from a command line:
ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) The command was successful. I did a WRKENVVAR to confirm the environmental variable was set correctly.

I then ran the SBMJOB command you provided to run the start.sh script.

However, I'm getting that pesky signal 5 error:
/dir/start.sh: 001-0078 Process ended by signal 5.

Do I need to add the environment variable to the submitted job? How would I do that in a qshell script?

Thanks,

Kelly Cookson
IT Project Leader
Dot Foods, Inc.
1.217.773.4486 ext. 12676
kcookson@xxxxxxxxxxxx



-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Aaron Bartell
Sent: Friday, August 21, 2015 12:10 PM
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Starting a node program so it keeps running without interactive jobs staying open.

In its simplest form you can do the following. Eventually you will want to add more options (i.e. start multiple instances on different ports for load balancing with a front-ending Apache/nginx instance).

SBMJOB JOB(QSH CMD('/dir/start.sh'))

---start.sh---
#!/usr/bin/sh
cd /dir
node sample.js


Aaron Bartell
litmis.com - Open Source and IBM i. No Limits.


On Fri, Aug 21, 2015 at 12:04 PM, Kelly Cookson <KCookson@xxxxxxxxxxxx>
wrote:

I have developed a "hello world" web server using JavaScript and
NodeJS. I am starting the web server using interactive sessions. I
open a 5250 session, then open an interactive qshell session, then run
the following
command:

node /mydirectory/sample.js

When the "hello world" web server is running, there are three jobs active:
1. My interactive 5250 session.
2. The qshell interpreter (QZSHSH)
3. A job that appears to be the node program (QP0ZSPWT).

But when I end the qshell session the node program (the QPOZSPWT job)
also ends. So my "hello world" web server is no longer running.

How do I get my "hello world" web server to run in NodeJS without me
having to leave an interactive qshell session open?

Thanks,

Kelly Cookson
IT Project Leader
Dot Foods, Inc.
1.217.773.4486 ext. 12676
kcookson@xxxxxxxxxxxx

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailing list To post a message email: WEB400@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.


___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/


________________________________

NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton
Hampshire
SO15 2EA
VAT Registration Number 834 1020 74.

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.