美文网首页
nginx nohup后台运行程序和关闭程序

nginx nohup后台运行程序和关闭程序

作者: 温暖柏林的伤 | 来源:发表于2019-03-28 15:43 被阅读0次

后台运行node服务

在xshell中运行如下

nohup npm run start &

然后在XShell中提示了nohup成功后:
nohup: ignoring input and appending output to ‘nohup.out’

然后按键盘任意键,回到xshell输入命令窗口,然后再XShell中输入:
exit

退出终端,这时候你的node就作为后台服务挂在linux上了。

ps -A查看后台运行程序进程
less nohup.out 查看后台运行程序日志

后台关闭node服务
找到node项目端口

netstat -nap|grep 7001

终止后台运行的程序

kill -9  进程号

相关文章

网友评论

      本文标题:nginx nohup后台运行程序和关闭程序

      本文链接:https://www.haomeiwen.com/subject/jkoqbqtx.html