Permalink
Browse files

Added support for pid-file-path. Ticket #445

  • Loading branch information...
1 parent 1052fbe commit f0cff4a9b2dcd6391efd05efb835a388be217e8c Anders Blockmar committed May 15, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 framework/src/play/src/main/scala/play/core/server/NettyServer.scala
@@ -150,8 +150,9 @@ object NettyServer {
// Manage RUNNING_PID file
java.lang.management.ManagementFactory.getRuntimeMXBean.getName.split('@').headOption.map { pid =>
- val pidFile = new File(applicationPath, "RUNNING_PID")
-
+ val pidPath = Option(System.getProperty("pidfile.path")).getOrElse(applicationPath.getAbsolutePath())
+ val pidFile = new File(pidPath, "RUNNING_PID")
+
if (pidFile.exists) {
println("This application is already running (Or delete the RUNNING_PID file).")
System.exit(-1)

0 comments on commit f0cff4a

Please sign in to comment.