-
-
Save EmmanuelKasper/9698253 to your computer and use it in GitHub Desktop.
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/sh | |
### BEGIN INIT INFO | |
# Provides: playframework | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start/Stop playframework | |
### END INIT INFO | |
# | |
#source some script files in order to set and export environmental variables | |
#as well as add the appropriate executables to $PATH | |
APP_DIST_HOME=/opt/popcon-1.1 | |
APP_NAME=popcon | |
OPTIONS="-DapplyEvolutions.default=true" | |
PIDFILE=$APP_DIST_HOME/RUNNING_PID | |
USER=popcon | |
GROUP=popcon | |
case "$1" in | |
start) | |
echo "Starting $APP_NAME in $APP_DIST_HOME" | |
START_CMD="$APP_DIST_HOME/bin/$APP_NAME $OPTIONS" | |
start-stop-daemon --start -p "$PIDFILE" --quiet --background --chuid ${USER}:${GROUP} --exec /bin/bash -- ${START_CMD} | |
;; | |
stop) | |
echo "Stopping $APP_NAME" | |
start-stop-daemon --stop -p "$PIDFILE" --stop "$USER" --retry 30 | |
;; | |
status) | |
if start-stop-daemon --status -p "$PIDFILE"; then | |
echo " $APP_NAME running with pid: $(cat $PIDFILE)" | |
else | |
echo "$APP_NAME not running" | |
fi | |
;; | |
*) | |
echo "Usage: /etc/init.d/playframework {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment