Skip to content

@bihe /init.d play
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
init.d script to launch Play framework under Ubuntu
#!/bin/sh
### BEGIN INIT INFO
## END INIT INFO
# Path to play install folder
PLAY_HOME=/usr/share/play
PLAY=$PLAY_HOME/play
# Path to the JVM
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
export JAVA_HOME
# User running the Play process
USER=www-data
# Path to the application
APPLICATION_PATH=/var/www/playapps/NAME_OF_APPLICATION
. /lib/lsb/init-functions
case "$1" in
start)
echo -n "Starting Play service: "
rm -f ${APPLICATION_PATH}/server.pid
su $USER -c "${PLAY} start ${APPLICATION_PATH} --%production >/dev/null"
RETVAL=$?
# You may want to start more applications as follows
# [ $RETVAL -eq 0 ] && su $USER -c "${PLAY} start application2"
# RETVAL=$?
if [ $RETVAL -eq 0 ]; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
echo -n "Shutting down Play service: "
${PLAY} stop ${APPLICATION_PATH} > /dev/null
# ${PLAY} stop application2 > /dev/null
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
log_end_msg 0
else
log_end_msg 1
fi
;;
status)
${PLAY} status ${APPLICATION_PATH}
RETVAL=$?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status}" >&2
exit 1
;;
esac
exit 0
@AmirKarimi

Does it work on Play 2.2.x? It didn't for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.