Skip to content

Instantly share code, notes, and snippets.

@notbrain
Created July 21, 2011 17:25
Show Gist options
  • Save notbrain/1097691 to your computer and use it in GitHub Desktop.
Save notbrain/1097691 to your computer and use it in GitHub Desktop.
upstart playframework launch script
# 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