node.js - xshell一退出,nodejs项目就停止
巴扎黑
巴扎黑 2017-04-17 13:32:22
0
7
691

xshell连接阿里云的centos,然后运行通过npm start运行一个node项目,关闭xshell后,node项目也没运行了,这个该怎么弄啊?

巴扎黑
巴扎黑

reply all(7)
左手右手慢动作

Go check the nohup command.

大家讲道理

Use & or ctrl+c to transfer the task to the background for execution.

迷茫

https://github.com/Unitech/PM2
Online deployment, using pm2 can automatically daemonize the process.

PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.

迷茫

Screen is a powerful tool

左手右手慢动作

I wrote a simple sh script and put the npm start command into it. Then nohup /root/test.sh & worked

大家讲道理

forever

小葫芦
screen -dmS win
screen -l
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template