Keep alive express process after close the terminal

匿名 (未验证) 提交于 2019-12-03 03:10:03

问题:

I'm trying to keep live a process after close the terminal. Is a node.js project with express. Basically, for other process I kept alive processes with:

$ node server.js & 

I with that, was possible finish the SSH connection and close the console. But with express, I started my process with:

$ npm start & 

And always, after one request, the process died. Exist a way to keep the process alive? I'm using EC2, with a Ubuntu instance.

回答1:

I found the answer https://unix.stackexchange.com/questions/89483/keeping-a-process-running-after-putty-or-terminal-has-been-closed

Basically, you can use nohup process. (Execute Commands After You Exit From a Shell Prompt).

And I used:

$ nohup npm start & 

And now is working good.



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