我在 aws 上部署了两个 node.js 应用程序,这两个应用程序位于显示为的路径中
/home/ubuntu/nodes/app1/app.js
/home/ubuntu/nodes/app2/app.js
分别
为了在后台运行 node.js 应用程序,我永远启动了两个应用程序,所以喜欢
$ sudo forever start /home/ubuntu/nodes/app1/app.js
$ sudo forever start /home/ubuntu/nodes/app2/app.js
因此,通过在后台进程中运行两个 node.js 应用程序,永远运行良好。但是,当我尝试使用这样的永久命令停止一个进程时。
$ sudo forever stop /home/ubuntu/nodes/app1/app.js
出乎意料的是,两个 node.js 进程都关闭了这样的信息
info: Forever stopped process:
data: uid command script forever pid logfile uptime
[0] r2pZ /usr/bin/nodejs app.js 24852 24854 /root/.forever/r2pZ.log 0:0:1:14.775
[1] 9f2h /usr/bin/nodejs app.js 24870 24872 /root/.forever/9f2h.log 0:0:0:58.733
我认为这是因为两个 node.js 进程具有相同的名称 - app.js,如何通过仅关闭一个进程来避免这种情况