I'm using Play Framework 2.6. After creating the production build zip using
dist
In the play console, I'm using this code to launch the application on the server
my-first-app-1.0/bin/my-first-app -Dconfig.file=/path/to/config -Dplay.http.secret.key=$APP_SECRET
this launches a console that ends with :
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
after which my server proceeds to work perfectly fine. However, closing the console (ctrl+C
) or exiting the terminal window; ctrl+d
does nothing either. What am I missing here?
update
So I looked through the logs, but exactly nothing happens before the server shuts down.
2018-04-20 02:24:36,207 [INFO] from application in application-akka.actor.default-dispatcher-28 - <some benign application log>
2018-04-20 02:36:25,881 [INFO] from play.core.server.AkkaHttpServer in Thread-5 - Stopping server...
2018-04-20 02:36:25,940 [INFO] from application in application-akka.actor.default-dispatcher-41 - Shutting down connection pool.
Of course, during this time my terminal had also disconnected (again, it seems to me that the way I'm starting my server is wrong, please advise.)
My problem seemed to indeed be that Play was quitting because of the console.
I managed to solve this by starting play using nohup:
nohup ~/myApp/bin/myApp -Dconfig.file=/path/to/conf -Dplay.http.secret.key=$SECRET &