Keep play application running after putty terminal

2019-05-30 16:02发布

How to keep play application running after putty terminal closed?

After deploying play application in to server, I ssh'ed into server with putty terminal and ran the play application.

However, once I close the putty terminal, play application no longer accepts http requests from client. To start the play application I used following command;

./{myplayapp}/bin/{executable} -Dhttp.port=8000

3条回答
一夜七次
2楼-- · 2019-05-30 16:21

Got the answer! Using & symbol run the process in background so that even if putty terminal is closed, process not terminated.

./{myplayapp}/bin/{executable} -Dhttp.port=8000 > app.out &
查看更多
我想做一个坏孩纸
3楼-- · 2019-05-30 16:26

I would recommend nohup:

nohup ./script -Dhttp.port=8000 &

It will create nohup.out file with all the logs. If you want to quit it, grep RUNNING_PID and sudo kill it.

查看更多
放荡不羁爱自由
4楼-- · 2019-05-30 16:42

use screen to start your application. view existing screens with "screen -ls" and switch between them with "screen -r" http://wiki.ubuntuusers.de/screen

查看更多
登录 后发表回答