2 # /etc/rc.d/skeleton_playapp : a generic playframework daemon for multiple instance of play applications (with a symlink).
3 # @see /etc/conf.d/playapp_sample for usage
9 .
/etc
/profile.d
/jre.sh
12 pidfile
=$PLAY_APP/server.pid
13 PID
=`cat $pidfile 2> /dev/null`
14 [[ -e $pidfile ]] && ( [ -n "`ps -p $PID | grep $PID`" ] ||
rm -f $pidfile) # rm pidfile if not process is running
15 PID
=`cat $pidfile 2> /dev/null`
19 stat_busy
"Starting Play framework $PLAY_APP app"
20 if [[ -z $PID ]] && su
- $PLAY_USER -c "export PATH=$PATH; play start $PLAY_APP $PLAY_ARGS"; then
30 stat_busy
"Stopping Play framework $PLAY_APP app"
31 if [[ ! -z $PID ]] && play stop
$PLAY_APP; then
46 echo "Usage: $0 {start|stop|restart}" >&2