Skip to content

Instantly share code, notes, and snippets.

@derek-schaefer
Created June 19, 2013 14:55
Show Gist options
  • Save derek-schaefer/5814957 to your computer and use it in GitHub Desktop.
Save derek-schaefer/5814957 to your computer and use it in GitHub Desktop.
A sample Upstart script for managing a Play application. Bypasses the "start" script.
description "Play"
env USER=user
env GROUP=group
env HOME=/opt/yourapp
env JAVA=/usr/bin/java
env JAVA_OPTS="-cp ./staged/* play.core.server.NettyServer ./.."
env PORT=80
env EXTRA="-Xms128M -Xmx512m -server"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
exec start-stop-daemon --start --chdir ${HOME} --exec /usr/bin/java \
-- -Dhttp.port=$PORT $EXTRA $JAVA_OPTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment