Last active
December 22, 2015 04:08
-
-
Save FGRibreau/6414542 to your computer and use it in GitHub Desktop.
How to make Play Framework 2 work with Supervisord and Monit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [program:myplayapp] | |
| ; remove -Dconfig.file if necessary (play will use the default application.conf) | |
| ; change address and port if necessary or remove them to use the default values | |
| command=java -Xms128M -Xmx512m -cp .:./lib/*:./target/staged/* -Dhttp.address=127.0.0.1 -Dhttp.port=9000 -Dconfig.file=./conf/application.prod.conf play.core.server.NettyServer . | |
| : directory to the play framework app, where "myapp/" is the root | |
| directory=/dir/to/myapp | |
| process_name=myplayapp | |
| autorestart=true | |
| startsecs=10 | |
| stopwaitsecs=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| check process myapp | |
| with pidfile /dir/to/myapp/RUNNING_PID | |
| start program = "/usr/bin/supervisorctl start myplayapp" | |
| stop program = "/usr/bin/supervisorctl stop myplayapp" | |
| if 10 restarts within 20 cycles | |
| then timeout | |
| if TOTALMEMORY > 2 GB for 4 cycles then restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment