[英]I run a production mode of play framework ,how to keep it running background
"./scorpio -Dhttp.port=10000 & " “ ./scorpio -Dhttp.port = 10000&”
doesn't work too enter image description here 也不起作用在这里输入图像描述
I use "activator dist" to deploy my play project,and i start my application as the fisrt pic, ./scorpio -Dhttp.port=10000 -Dplay.evolutions.db.default.autoApply=true -Dplay.crypto.secret=QCY?Anfk?aZ?iwrNwnxIR6 how to start it so the application will run on background 我使用“激活程序dist”部署我的游戏项目,并以第一个图片启动应用程序。/ scorpio -Dhttp.port = 10000 -Dplay.evolutions.db.default.autoApply = true -Dplay.crypto.secret = QCY?Anfk?aZ?iwrNwnxIR6如何启动它,因此应用程序将在后台运行
It is not play related. 它与游戏无关。 It is about how to start any other java / shell application in the background. 它是关于如何在后台启动任何其他Java / shell应用程序。
It is already answered for example here: How to run a shell script in the background and get no output 例如,已经在这里得到解答: 如何在后台运行Shell脚本并且不获取任何输出
As @Micahl mentioned it's not play related but any script running on linux. 正如@Micahl所提到的,它与游戏无关,但与在Linux上运行的任何脚本无关。 nohup
is your friend. nohup
是你的朋友。 read more here 在这里阅读更多
nohup ./scorpio -Dhttp.port=10000 >/dev/null 2>&1
make sure the application logging is configured properly to a file as the above command will redirect all stdout to /dev/null. 确保将应用程序日志记录正确配置到文件,因为上述命令会将所有标准输出重定向到/ dev / null。
If you are running play app in production I am recommending to build a system package with sbt-native-packager
. 如果您正在生产中运行play app,建议您使用sbt-native-packager
构建系统软件包。 Builded packages use system level services to run app in background, have proper configuration and have convenient versioning tools. 生成的软件包使用系统级服务在后台运行应用程序,具有正确的配置和便捷的版本控制工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.