[2.0] Programatically shut down Play 2.0?

988 views
Skip to first unread message

Jostein Austvik Jacobsen

unread,
Oct 5, 2012, 9:06:15 AM10/5/12
to play-fr...@googlegroups.com
Is it possible to create a button on a Play 2.0-based website which, when clicked, would stop the website (equivalent of "play stop") ?

Jostein

Guillaume Bort

unread,
Oct 5, 2012, 9:56:23 AM10/5/12
to play-fr...@googlegroups.com
Calling System.exit() is enough to shut down the JVM.
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.



--
Guillaume Bort, http://guillaume.bort.fr

Marconi

unread,
Oct 5, 2012, 3:09:09 PM10/5/12
to play-fr...@googlegroups.com
What about a graceful restart? Is it possible to stop accepting new requests, wait for all open connections to close, and then restart the instance reloading changes from disk? I mean, programatically in production mode?

Manuel Bernhardt

unread,
Oct 6, 2012, 5:37:32 AM10/6/12
to play-fr...@googlegroups.com
What I thought of doing at some point was to set-up a mechanism (for
continuous deployment) which would shut down the JVM with a specific
exit code (e.g. -2) and have the JVM process watched by a linux agent
of sorts (I think one process-watching tool was mentioned on the list
before) which then would restart it after updating the version.
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/3RhI4UgctbkJ.

James Roper

unread,
Oct 7, 2012, 9:20:35 PM10/7/12
to play-fr...@googlegroups.com
Then simply System.exit(-2).

Manuel Bernhardt

unread,
Oct 8, 2012, 3:25:15 AM10/8/12
to play-fr...@googlegroups.com
On Mon, Oct 8, 2012 at 3:20 AM, James Roper <jro...@gmail.com> wrote:
> Then simply System.exit(-2).

Yes, it was more of a suggestion to Marconi on how to restart from
within the application. Though it won't do it gracefully (i.e. running
connections will just be cut off).
> https://groups.google.com/d/msg/play-framework/-/2Ainrixfp8IJ.

Jostein Austvik Jacobsen

unread,
Oct 8, 2012, 4:02:21 AM10/8/12
to play-fr...@googlegroups.com
Thanks!

Jostein

Nilanjan

unread,
Oct 9, 2012, 7:19:18 PM10/9/12
to play-fr...@googlegroups.com
I have done something similar using HAProxy

Nilanjan
Reply all
Reply to author
Forward
0 new messages