#!/bin/bash

# Avoid Neighbour table overflow
sysctl -w net.ipv4.neigh.default.gc_thresh3=4096
sysctl -w net.ipv4.neigh.default.gc_thresh2=2048

export PATH=/var/vcap/packages/golang/bin:$PATH
export BUNDLE_GEMFILE=/var/vcap/packages/nats/Gemfile

RUN_DIR=/var/vcap/sys/run/nats
LOG_DIR=/var/vcap/sys/log/nats
CONFIG_FILE=/var/vcap/jobs/nats/config/nats.cfg
PIDFILE=$RUN_DIR/nats.pid
RUNAS=vcap

case $1 in

  start)
    mkdir -p $RUN_DIR $LOG_DIR
    echo $$ > $PIDFILE
    chown -R $RUNAS:$RUNAS $RUN_DIR $LOG_DIR

    exec chpst -u $RUNAS:$RUNAS /var/vcap/packages/gonats/bin/gnatsd \
      -c $CONFIG_FILE \
      >>  $LOG_DIR/nats.stdout.log \
      2>> $LOG_DIR/nats.stderr.log
    ;;

  stop)
    if [ -f $PIDFILE ]; then
      kill -9 `cat $PIDFILE` || true
      rm -f $PIDFILE
    fi
    ;;

  *)
    echo "Usage: nats_ctl {start|stop}" ;;
esac

#!/bin/bash

# Avoid Neighbour table overflow
sysctl -w net.ipv4.neigh.default.gc_thresh3=4096
sysctl -w net.ipv4.neigh.default.gc_thresh2=2048

export PATH=/var/vcap/packages/golang/bin:$PATH

RUN_DIR=/var/vcap/sys/run/nats
LOG_DIR=/var/vcap/sys/log/nats
CONFIG_FILE=/var/vcap/jobs/nats/config/nats.cfg
PIDFILE=$RUN_DIR/nats.pid
RUNAS=vcap

case $1 in

  start)
    mkdir -p $RUN_DIR $LOG_DIR
    echo $$ > $PIDFILE
    chown -R $RUNAS:$RUNAS $RUN_DIR $LOG_DIR

    exec chpst -u $RUNAS:$RUNAS /var/vcap/packages/gonats/bin/gnatsd \
      -c $CONFIG_FILE \
      >>  $LOG_DIR/nats.stdout.log \
      2>> $LOG_DIR/nats.stderr.log
    ;;

  stop)
    if [ -f $PIDFILE ]; then
      kill -9 `cat $PIDFILE` || true
      rm -f $PIDFILE
    fi
    ;;

  *)
    echo "Usage: nats_ctl {start|stop}" ;;
esac

Remove unused reference to Gemfile in control script.
Remove unused reference to Gemfile in control script.

[#149182955](https://www.pivotaltracker.com/story/show/149182955)

Signed-off-by: Dale Wick <188d987a4b971a1fecf708bf002a3b94c86c96a2@pivotal.io>
