Start critter corral
This file contains 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 script for a play application that binds to an unprivileged user. | |
# put this into a file like /etc/init/play.conf | |
# | |
# This could be the foundation for pushing play apps to the server using something like git-deploy | |
# By calling service play stop in the restart command and play-start in the restart command. | |
# | |
# Usage: | |
# start play | |
# stop play | |
# restart play | |
# | |
# WARNING: This is still beta, I have not tested the respawning functionality, but it should work. | |
# | |
# http://leon.radley.se | |
# from: https://gist.github.com/leon/2204773 | |
description "Critter Corral Server Startup Script" | |
author "Jay Pfaffman" | |
version "1.0" | |
env USER=play | |
env GROUP=play | |
env HOME=/home/play/ccorral-1.0-SNAPSHOT | |
env PORT=9000 | |
env ADDRESS=0.0.0.0 | |
env CONFIG=production.conf | |
env SBTMEM=256 | |
env EXTRA="-Xms128M -Xmx512m -server" | |
# See http://www.playframework.com/documentation/2.0/ProductionConfiguration | |
# for info about production.conf | |
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
respawn limit 10 5 | |
umask 022 | |
expect daemon | |
# exec start-stop-daemon --pidfile ${HOME}/RUNNING_PID --chuid $USER:$GROUP --exec ${HOME}/target/start --background --start -- -Dconfig.resource=$CONFIG -Dhttp.port=$PORT -Dhttp.address=$ADDRESS $EXTRA | |
exec start-stop-daemon -v --pidfile ${HOME}/RUNNING_PID --make-pidfile --chuid $USER:$GROUP --exec ${HOME}/start --background --start -- -Dhttp.port=$PORT -Dhttp.address=$ADDRESS $EXTRA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment