2

In play 2.1, I use "play start" and then "ctrl + D"

In play 2.3.x, it is activator start & ctrl +D

But in play 2.5.x, activator start will be deprecated.

The document says that we can run the production mode as below:

`$ activator clean stage
$ target/universal/stage/bin/my-first-app -Dplay.crypto.secret=abcdefghijk`

But it would stuck and ctrl+d is not working anymore. So I have to use nohup command to run my application. Anyone knows how to run play framework 2.5 in background as before?


Edit: Now I use "nohup target/universal/stage/bin/prj-name > app.log & " to start my server. But the log format is totally wrong like [^[[37minfo^[[0m] application -... instead of 2016-11-09 03:05:01,157 [INFO] from application in pool-6-thread-4 - Application... The later one is the correct format when I start my server by "activator start".

Mark_H
  • 770
  • 1
  • 6
  • 19
  • What's wrong with nohup ? – AME Nov 12 '16 at 17:10
  • http://stackoverflow.com/questions/10729443/scala-start-play-server-in-production – jacks Nov 12 '16 at 21:16
  • @ALEX_AME I configure the log, all logs are written into nohup.out with the format [^[[37minfo^[[0m] ... But I think it should be written into application.log with the right format "2016-11-29 15:03:26 +0800 [INFO] from application in ForkJoinPool.commonPool-worker-1..." – Mark_H Nov 29 '16 at 07:03

1 Answers1

0

You can try

Compile:

./activator stage -java-home /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home

Start:

target/universal/stage/bin/serivce_app -Dhttp.port=8080 -Dconfig.file=conf/stage.conf -java-home /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home &
abronan
  • 3,309
  • 4
  • 29
  • 38
Neil_TW
  • 97
  • 5