Created
July 21, 2011 17:25
-
-
Save notbrain/1097691 to your computer and use it in GitHub Desktop.
upstart playframework launch script
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
# upstart play framework script | |
# thanks to: | |
# http://geeknme.wordpress.com/2009/10/15/getting-started-with-upstart-in-ubuntu/ | |
# this script will start/stop play framework | |
# place in /etc/init | |
description "start and stop the play framework" | |
version "1.0" | |
author "Brian Ross" | |
env PLAY_ID=prod | |
env PLAY_BINARY=/usr/local/bin/play | |
env PLAY_HOME=/path/to/application | |
env PLAY_PORT=80 | |
start on runlevel [2345] | |
# tell upstart we're creating a daemon | |
# upstart manages PID creation for you. | |
expect fork | |
pre-start script | |
chdir $PLAY_HOME | |
exec $PLAY_BINARY deps | |
emit play_dependencies | |
end script | |
script | |
# START PLAY | |
chdir $PLAY_PORTAL_HOME | |
exec /usr/local/bin/play start --%$PLAY_ID -Xmx512m | |
# create a custom event in case we want to chain later | |
emit play_${PLAY_ID}_running | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment