Play Framework 2.1 的“播放停止"相当于什么? [英] What is the equivalent to 'play stop' for Play Framework 2.1?

查看:20
本文介绍了Play Framework 2.1 的“播放停止"相当于什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Play 2.1 中 play stop 的等价物是什么?

What is the equivalent of play stop for Play 2.1?

如果我做了play start,我如何干净地终止进程?

If I did play start, how do I cleanly terminate the process?

推荐答案

在文档:

当您运行 start 命令时,Play 会创建一个新的 JVM 并运行默认的 Netty HTTP 服务器.标准输出流被重定向到 Play 控制台,因此您可以监控其状态.

When you run the start command, Play forks a new JVM and runs the default Netty HTTP server. The standard output stream is redirected to the Play console, so you can monitor its status.

服务器的进程 ID 在引导时显示并写入 RUNNING_PID 文件.要杀死正在运行的 Play 服务器,只需向进程发送 SIGTERM 以正确关闭应用程序就足够了.

The server’s process id is displayed at bootstrap and written to the RUNNING_PID file. To kill a running Play server, it is enough to send a SIGTERM to the process to properly shutdown the application.

如果您键入 Ctrl+D,Play 控制台将退出,但创建的服务器进程将继续在后台运行.然后关闭分叉的 JVM 的标准输出流,并且可以从 logs/application.log 文件中读取日志记录.

If you type Ctrl+D, the Play console will quit, but the created server process will continue running in background. The forked JVM’s standard output stream is then closed, and logging can be read from the logs/application.log file.

所以我认为你必须使用play run 而不是play start.然后您就可以使用 Ctrl+D 停止播放.

So I think that you have to use play run instead of play start. Then you'll be able to use Ctrl+D to stop play.

这篇关于Play Framework 2.1 的“播放停止"相当于什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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