-
-
Save shantanusingh/3d868eedda71540dd909 to your computer and use it in GitHub Desktop.
Play 2 init.d script
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
#!/bin/bash | |
# description: UAB Play App | |
# processname: uab | |
# chkconfig: 234 20 80 | |
# User running the Play process | |
USER=ec2-user | |
USER_HOME=/home/ec2-user | |
# Java home, add java and play to path | |
#export JAVA_HOME=$USER_HOME/java_home | |
export PATH=$JAVA_HOME/bin:$USER_HOME/libs/play:$PATH | |
# Path to the application | |
APP_PATH=$USER_HOME/apps/uab/target/universal/stage | |
APP_OPTS="-Dconfig.file=$APP_PATH/conf/prod.conf" | |
RETVAL=0 | |
case "$1" in | |
start) | |
echo -n "Starting Play service" | |
rm -f ${APP_PATH}/RUNNING_PID | |
su $USER -c "$APP_PATH/bin/uab $APP_OPTS >/dev/null" & | |
RETVAL=$? | |
;; | |
stop) | |
echo -n "Shutting down Play service" | |
kill `cat $APP_PATH/RUNNING_PID` | |
RETVAL=$? | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment