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



Never mind. I figured out that I could use NETSTAT, option 3 and look for my port number. Then take option 4 to end the job. That seems to have worked.

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 Kelly Cookson
Sent: Thursday, August 20, 2015 3:28 PM
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Ending a node web server from QSH session

Okay, so I'm pretty sure not ending the job as instructed (or maybe not ending it at all) is causing me problems.

I made a change, and now I want to start the web server again. I'm using the following command in QSH:

node /mydirectory/node/sample.js
Server running at http://mysystem:8888

events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at net.js:1146:9
at asyncCallback (dns.js:68:16)
at Object.onanswer [as oncomplete] (dns.js:121:9)
$

I did a WRKACTJOB, but I can't identify the job.

Any ideas?


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: Thursday, August 20, 2015 3:09 PM
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Ending a node web server from QSH session

Crap. Scratch what I said about bash. I just remembered I've had race condition issues with it when exiting the Node.js REPL. Instead use
zsh(n1) from perzl (if you go this route).

Here are the install instructions for zsh (reference the article first to learn how to install the base shell scripts):

$ cd /QOpenSys/download
$ ./wwwperzl.sh aix61 wget zsh-5.0.5
$ ./wwwperzl.sh aix61 rpm zsh-5.0.5

n1 http://www.perzl.org/aix/index.php?n=Main.Zsh

Aaron Bartell
Litmis.com

On Thu, Aug 20, 2015 at 2:06 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:

I don't have an answer for QSH but can offer a significantly better
alternative...

In this article** I describe how to install Git from perzl.org. The
same can be done to install bash (bourne again shell). Then you
should run STRTCPSVR *SSHD to start ssh on your IBM i. Then from your
laptop run "ssh ibmiprofile@ibmi_ip_address" to log into your IBM i.
And once logged in run "bash" and that will put you in a bash shell.

Or a shorter option would be to skip bash and only do STRTCPSVR *SSHD
and use the default Korn shell that comes with IBM i. In this option
you'd still use something like putty to create an ssh connection to your IBM i.
Then once in putty you can use Ctrl+C to end a node server.

**
http://www.mcpressonline.com/scripting/techtip-installing-git-on-ibm-i
.html

​Hope that helps,​
​Aaron Bartell​
​Litmis.com​


On Thu, Aug 20, 2015 at 1:54 PM, Kelly Cookson <KCookson@xxxxxxxxxxxx>
wrote:

My managers have given me the green light to explore node on the IBM
i (7.1).

I'm following the IBM developerWorks getting started page at:
https://www.ibm.com/developerworks/ibmi/library/i-native-js-app-ibmi-with-nodejs/.
The section of the page called "Create a web application using
Node.js" has instructions for developing a hello world web server. I
was able to get the hello world web server to run successfully:
* I created the sample.js file
* I put the sample.js file in the IFS
* I started a qshell session
* I executed the command "node /mydirectory/sample.js".
* I confirmed the web server was running by pointing my browser to
the URL and seeing the hello world message.

Here's where I got a little confused. The developerWorks page says:

"To end the web server job, you can press the Esc key within the QSH
session and select option 2 to work with the current jobs. Next, end
the job running the node program with option 4 as shown in Figure 6."

While still in the qshell session, I pressed the escape key on my
keyboard, but I did not get any options at all. I did not see a way
to follow these instructions for ending the job. I used F3 to exit
the qshell session. I pointed my browser to the URL, and it returned
the standard browser message saying the page was not available.

If a node web server is started in a qshell session, is it okay to
end the web server by simply stopping the qshell session?

Why did I not see any options when I pressed the escape key while in
the qshell session?

Thanks,

Kelly Cookson
IT Project Leader
Dot Foods, Inc.
1.217.773.4486 ext. 12676
kcookson@xxxxxxxxxxxx<mailto: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.


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.