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



Ok, something isn't right with my script...

QSH CMD('"/home/bvstone/startNode.sh"')

<Script>
-------------------------
#!/QOpenSys/usr/bin/sh
PATH=/QOpenSys/QIBM/ProdData/OPS/Node4/bin:$PATH
pm2 stop all
pm2 delete all
pm2 start /nodejs/braintreetest/bin/www --name "bttest"
pm2 start /nodejs/bvstools/nodejsdemo/bin/www --name "njsdemo"
-------------------------


When I do this then list the active processes with pm2 list, the first one
doesn't have a name:

┌─────────┬──────┬────────┬───┬─────┬────────┐
│ Name │ mode │ status │ ↺ │ cpu │ memory │
├─────────┼──────┼────────┼───┼─────┼────────┤
│ fork │ online │ 0 │ 0% │ 0 B │
│ njsdemo │ fork │ online │ 0 │ 0% │ 0 B │
└─────────┴──────┴────────┴───┴─────┴────────┘

Hope that comes through ok.. I tried switching the two around and
whichever one is first ends up like is shown (no name, which messes up the
list)

It is running, though.

I tried all these commands separately on a PASE shell and things worked as
expected. I can't figure out what the difference would be between command
line entry on the PASE shell vs running the script.

On Wed, Mar 14, 2018 at 11:31 AM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:

Put it in a shell script with a shebang so it gets out of QSH and into a
true shell (i.e. bash).


---start.sh---
#!/usr/bin/bash

node app.js



Aaron Bartell
IBM i hosting, starting at $157/month. litmis.com/spaces


On Wed, Mar 14, 2018 at 9:44 AM, Bradley Stone <bvstone@xxxxxxxxx> wrote:

I am trying to write a CL that will start my node instances using pm2.
I'm
starting out using qshell to verify the commands will work.

It works fine using a ssh client, but qshell seems to error out. Here
are
the qshell commands I'm running:

QIBM_MULTI_THREADED=Y
PATH=/QOpenSys/QIBM/ProdData/OPS/Node4/bin:$PATH
pm2 start /nodejs/mynodeapp/bin/www --name="myapp"

It is using express and this works fine in the ssh client I'm using. I
did
set the path, as shown, to match that of my ssh client. The
QIBM_MULTI_THREADED=Y
was also needed and got me further, but now the node job doesn't start

The pm2 log shows this:

exec(): 0509-036 Cannot load program node because of the following
errors:
0509-150 Dependent module
/QOpenSys/opt/freeware/bin/../lib/gcc/powerpc-ibm-aix6.1.0.
0/4.8.2/../../../libcrypto.a(libcrypto.so.1.0)
could not be loaded.
0509-152 Member libcrypto.so.1.0 is not found in archive

Seems like a path issue.. or something else. but comparing environment
variables between qshell and ssh client I don't see anything that sticks
out.


Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #20 <https://www.bvstools.com/mailtool.html>: The
ability
to specify multiple email routers/relays to make sure emails are sent
when
they need to be.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource.

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource.


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.