anchor.diff:  # See how we were called.
   case "$1" in
     start)
  -        init_rvm
           start
           ;;
     stop)
  -        init_rvm
           stop
           ;;
     status)
           status
           ;;
     restart|reload)
  -        init_rvm
           restart
           ;;
     *)
  
positive.code: 
  start() {
      [ ! -z "$(get_pid)" ] && { status; return 1; }
      echo -n $"Starting ${process_name}:"
      # TODO - background using sinatra option?
      su - <%=  APP[:run_as] %> -s /bin/bash -c "cd <%= $nagira_root %> && RACK_ENV=production bundle exec ./nagira.rb" > <%= APP[:log] %> 2>&1 &
      sleep 5
      process=$(get_pid)
      if [ -z "$process" ]; then
          echo "   [FAIL]"
      else
          echo "    OK"
      fi
  }
  
  
negative.code:     # TODO: need testing
      local process=$(get_pid)
      kill $process
      \rm -f $pid_file
      RETVAL=$?
      sleep 2
      [ -z "$(get_pid)" ] && { echo OK; return $RETVAL; }
  