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 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-2020 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].