Sha256: d419e7dd0af47c8767f4397e42fa7bff92fc2bc269446246e63cb2ce38a33bb1

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

#!/bin/sh
### BEGIN INIT INFO
# Provides:          stompserver_ng
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop the stompserver_ng gem
### END INIT INFO
#
NAME=stompserver_ng
DESC="stompserver_ng ruby gem"
#
NAMEHOME=/home/$NAME
#
CONFIGFILE="$NAMEHOME/$NAME.conf"
STOMPCMD="$NAMEHOME/bin/runserver.sh"
#
WORKDIR=$(grep "working_dir" $CONFIGFILE | cut -d" " -f2)
PIDFILE="$WORKDIR/$NAME.pid"
#
EXTRA_OPTS="--daemon --session_cache=25 -C $CONFIGFILE"
EXTRA_OPTS="${EXTRA_OPTS} ${STOMP_OPTS}"
#
set -e
# set -x
#
case "$1" in
    start)
        echo -n "Starting $DESC: "
        test -f /var/tmp/ruby-uuid && rm /var/tmp/ruby-uuid
        test -d $WORKDIR && rm -rf $WORKDIR
        su -l $NAME -c "$STOMPCMD $EXTRA_OPTS"
        echo "$NAME."
        ;;
    stop)
        echo -n "Stopping $DESC: "
        pid=$(ps -ef | grep -i stompserver | grep -i ruby |awk '{print $2}')
        kill $pid
        echo "$NAME."
        ;;
    *)
        echo "Usage: $0 { start | stop }" >&2
        exit 1
        ;;
esac
#
# set +x
exit 0

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stompserver_ng-1.0.6 etc/stompserver_ng