node.js processes with the same name in forever are closed when trying to close only one

半腔热情 提交于 2019-11-29 01:35:31
Guillaume

You can kill only one process using the index of the process shown in the forever list command. For example, if you type forever stop 1, only the process with the index 1 will be killed

You can use an uid (see here):

$ sudo forever --uid "app1" start app.js
$ sudo forever --uid "app2" start app.js

And to stop:

$ sudo forever stop app1

Update
The --uid option is deprecated. Now you can use the --pidFile option. Example:

forever start --pidFile /some/path/app1.pid app.js
forever start --pidFile /some/path/app2.pid app.js

And to stop:

forever stop --pidFile /some/path/app1.pid
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!