扫码关注官方订阅号
xshell连接阿里云的centos,然后运行通过npm start运行一个node项目,关闭xshell后,node项目也没运行了,这个该怎么弄啊?
你去查查nohup这个命令。
通过&或者ctrl+c把任务转到后台执行即可。
&
ctrl+c
https://github.com/Unitech/PM2 线上部署,使用pm2能自动守护进程。
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 是个利器
写了个简单的sh脚本,把npm start命令放入。然后 nohup /root/test.sh & 竟然可以了
forever
screen -dmS win screen -l
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你去查查nohup这个命令。
通过
&或者ctrl+c把任务转到后台执行即可。https://github.com/Unitech/PM2
线上部署,使用pm2能自动守护进程。
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 是个利器
写了个简单的sh脚本,把npm start命令放入。然后 nohup /root/test.sh & 竟然可以了
forever