Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
Created August 30, 2012 22:21
Show Gist options
  • Select an option

  • Save jaytaylor/3542939 to your computer and use it in GitHub Desktop.

Select an option

Save jaytaylor/3542939 to your computer and use it in GitHub Desktop.
SendHub API Ubuntu Upstart init script
# SendHub API Service
description "Play-Framework 2.0.x SendHub API"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn limit 10 5
console output
script
export PLAY_PATH='/opt/sendhub/play'
export PLAY_FLAGS='-DapplyEvolutions.default=false -Dconfig.file=conf/prod.conf -Dlogger.file=conf/prod-logger.xml'
export APP_PID_FILE='/tmp/api.pid'
export JVM_FLAGS=''
export DEPLOY_TO='/opt/sendhub/api'
#sudo rm -f -- $APP_PID_FILE
cd "$DEPLOY_TO/current"
sudo -E -u ubuntu ${PLAY_PATH}/play ${PLAY_FLAGS} -Dpidfile.path=${APP_PID_FILE} ${JVM_FLAGS} start
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment