在后台RHEL中运行时出现JSReport错误“此套接字已关闭”

时间:2016-06-27 20:36:53

标签: javascript node.js socket.io npm jsreport

我在JSReport www.jsreport.net中遇到了一个问题。

如果我在后台启动npm start --production,它可以工作,但如果我退出此会话,则会发生错误:

Error occured - This socket is closed.
Stak - Error: This socket is closed.
    at WriteStream.Socket._write (net.js:638:19)
    at doWrite (_stream_writable.js:226:10)
    at writeOrBuffer (_stream_writable.js:216:5)
    at WriteStream.Writable.write (_stream_writable.js:183:11)
    at WriteStream.Socket.write (net.js:616:40)

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

要在linux后台启动jsreport,我使用

nohup npm start --production > /dev/null 2>&1 &

在后台启动jsreport并在重启时启动自动启动

# install pm2
sudo npm install pm2 -g

# start pm2 daemon running jsreport
sudo pm2 start npm -- start --production

# create startup script for running jsreport after boot
sudo pm2 startup
sudo pm2 save