后臺運(yùn)行node服務(wù)
在xshell中運(yùn)行如下
nohup npm run start &
然后在XShell中提示了nohup成功后:
nohup: ignoring input and appending output to ‘nohup.out’
然后按鍵盤任意鍵,回到xshell輸入命令窗口,然后再XShell中輸入:
exit
退出終端,這時(shí)候你的node就作為后臺服務(wù)掛在linux上了。
ps -A查看后臺運(yùn)行程序進(jìn)程
less nohup.out 查看后臺運(yùn)行程序日志
后臺關(guān)閉node服務(wù)
找到node項(xiàng)目端口
netstat -nap|grep 7001
終止后臺運(yùn)行的程序
kill -9 進(jìn)程號