-
-
Save istvano/c34b29106ec1c92d0b7a28c84e729b50 to your computer and use it in GitHub Desktop.
Upstart script for Play Framework 2.2.
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
description "Play Application Upstart script" | |
env USER=username | |
env GROUP=username | |
env HOME=/your/project/root/folder | |
env PORT=8080 | |
env ADDRESS=127.0.0.1 | |
env MEM=4096 | |
env PROJECT=project_name | |
env EXTRA_PARAMS="" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
respawn limit 30 20 | |
umask 022 | |
expect daemon | |
pre-start script | |
#If improper shutdown and the PID file is left on disk delete it so we can start again | |
if [ -f $HOME/RUNNING_PID ] && ! ps -p `cat $HOME/RUNNING_PID` > /dev/null ; then | |
rm $HOME/RUNNING_PID ; | |
fi | |
end script | |
exec start-stop-daemon --chdir ${HOME} --pidfile ${HOME}/RUNNING_PID --chuid $USER:$GROUP --exec ${HOME}/bin/${PROJECT} --background --start -- -Dhttp.port=$PORT -Dhttp.address=$ADDRESS -mem ${MEM} -J-server $EXTRA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment