[chef] Running node.js instance on Node


Chronological Thread 
  • From: Christopher Hahn < >
  • To:
  • Subject: [chef] Running node.js instance on Node
  • Date: Sat, 18 Apr 2015 16:14:06 -0700

Hello, 

All apologies...I used an old message to get the address right, and left the old Subject there.

Take care,

Christopher

On Apr 18, 2015, at 4:08 PM, Christopher Hahn < "> > wrote:

Hello,

While I try to figure out how to get node to at least temporarily log it's errors, 
I am hoping that there is a common issue with launching node instances
from Chef.

The recipe is simple:

The script has eight lines, all just like this:

run.sh:
==============
node script1.js &
node script2.js &
node script3.js &
node script4.js &
node script5.js &
node script6.js &
node script7.js &
==============

The entire recipe is:
==============
execute "execute run.sh" do
  cwd "/opt/prodname/data"
  command "./run.sh"
  action :run
end
==============

At first I thought that it might not be running, but checking the process table
for instances of node (or processes that contain the string "node" ;0) showed that
the node instances were launched but that they dropped out of memory a few seconds
late: (every -- == one second)

while (true) do ps -ef | grep node| grep -v grep; echo "--"; sleep 1; done
--
--
--
--
-- (at first, they all appeared)
root     10983     1  5 20:49 ?        00:00:00 node script1.js
root     10984     1  6 20:49 ?        00:00:00 node script2.js
root     10985     1  6 20:49 ?        00:00:00 node script3.js
root     10986     1  7 20:49 ?        00:00:00 node script4.js
root     10987     1  5 20:49 ?        00:00:00 node script5.js
root     10988     1  7 20:49 ?        00:00:00 node script6.js
root     10989     1  6 20:49 ?        00:00:00 node script7.js
--
root     10983     1 16 20:49 ?        00:00:00 node script1.js
root     10984     1 16 20:49 ?        00:00:00 node script2.js
root     10985     1 18 20:49 ?        00:00:00 node script3.js
root     10986     1 18 20:49 ?        00:00:00 node script4.js
root     10987     1 16 20:49 ?        00:00:00 node script5.js
root     10988     1 17 20:49 ?        00:00:00 node script6.js
root     10989     1 16 20:49 ?        00:00:00 node script7.js
--
root     10985     1 20 20:49 ?        00:00:00 node script3.js <---then only 5!
root     10986     1 20 20:49 ?        00:00:00 node script4.js
root     10987     1 21 20:49 ?        00:00:00 node script5.js
root     10988     1 20 20:49 ?        00:00:00 node script6.js
root     10989     1 20 20:49 ?        00:00:00 node script7.js
--
-- <--- at this point they have all terminated
--
--

I tried adding redirection to the lines in run.sh, to ensure that no output was uncultured
but to no avail. (i.e. adding 2>&1 >/tmp/script#out resulted in no output to these logs)

This seems like more of a node question, and if you can confirm that this is the case, 
then I will turn to that, with appreciation.

Thank you for the time!

Christopher









Archive powered by MHonArc 2.6.16.

§