【问题标题】:Play Framework cannot create RUNNING_PID File in UbuntuPlay Framework 无法在 Ubuntu 中创建 RUNNING_PID 文件
【发布时间】:2017-05-01 16:00:50
【问题描述】:

我已将我的应用程序分发到 Linux (Ubuntu)。当我尝试从服务器运行 bin 文件夹中的文件时,我收到此错误:

Oops, cannot start the server.
java.io.FileNotFoundException: /opt/co-assist/RUNNING_PID (Permission denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at play.core.server.ProdServerStart$.createPidFile(ProdServerStart.scala:131)
        at play.core.server.ProdServerStart$.start(ProdServerStart.scala:45)
        at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
        at play.core.server.ProdServerStart.main(ProdServerStart.scala)

我看到了一些关于此错误的帖子,但没有解决我的问题。

我已尝试创建 application.ini 文件并添加 play.pid 文件,但我猜这不是解决方法: https://playframework.com/documentation/2.5.x/Deploying#Play-PID-Configuration

我也看到了这个: https://www.playframework.com/documentation/2.5.x/ProductionConfiguration#Changing-the-path-of-RUNNING_PID

我不确定如何正确设置 - 有谁知道我是否可以遵循更详细的说明?

感谢您的帮助...

【问题讨论】:

    标签: ubuntu playframework


    【解决方案1】:

    我使用了这篇文章的答案: Play change RUNNING_PID file path

    将此添加到我的 application.conf 文件中:

    play.server.pidfile.path=/var/run/RUNNING_PID
    

    工作就像一个魅力!

    【讨论】:

      猜你喜欢
      • 2015-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-06
      相关资源
      最近更新 更多