anchor.diff:      ;;
   
     stop)
  -    # TODO: use the jmeter builtin script to kill the server
  -    # You better not colocated any JAVA app with this job, for now :-)
  -    pushd /var/vcap/packages/jmeter/bin
   
       kill -9 `cat $PIDFILE`
       rm -f $PIDFILE
  -
  -    # Nuke Any JAVA process
  -    pkill -f java
   
       ;;
   
  
positive.code: 
      pushd /var/vcap/packages/jmeter/bin
  
      exec ./jmeter ${RMI_HOST_DEF} \
        -Dserver_port=${SERVER_PORT:-1099} \
        -s \
        --jmeterlogfile $LOG_DIR/jmeter-server.log \
  
negative.code: RMI_HOST_DEF=-Djava.rmi.server.hostname=<%=spec.networks.to_h.values.first.ip%>
  PIDFILE=${RUN_DIR}/pid
  
  # JAVA options
  HEAP="-Xms512m -Xmx512m"
  TENURING="-XX:MaxTenuringThreshold=2"
  CLASS_UNLOAD="-XX:+CMSClassUnloadingEnabled"
  DUMP="-XX:+HeapDumpOnOutOfMemoryError"
  SERVER="-server"
  ARGS="$SERVER $DUMP $HEAP $TENURING $CLASS_UNLOAD"
  
  case $1 in
  
    start)
  
      mkdir -p $RUN_DIR $LOG_DIR
      chown -R vcap:vcap $RUN_DIR $LOG_DIR
  