关闭终端后保持活动快递流程 [英] Keep alive express process after close the terminal

查看:177
本文介绍了关闭终端后保持活动快递流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关闭终端后,我试图保持一个进程。
是一个具有express的node.js项目。
基本上,对于其他进程,我保持活动进程:

  $ node server.js& 

我可以完成SSH连接并关闭控制台。
但是用快递,我开始了我的过程:

  $ npm start& 

总是在一个请求之后,进程死机。
存在一种保持进程的方法吗?
我使用的是EC2,带有一个Ubuntu实例。

解决方案

我发现答案
https://unix.stackexchange.com/问题/ 89483 /保持一个过程运行后的putty或终端已被关闭



基本上,您可以使用< a href =http://www.cyberciti.biz/tips/nohup-execute-commands-after-you-exit-from-a-shell-prompt.html =nofollow noreferrer> nohup 处理。 (从Shell提示符退出后执行命令)。



我使用了:

 code> $ nohup npm start& 

现在运行良好。


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.

解决方案

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.

这篇关于关闭终端后保持活动快递流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆