anchor.diff:  fi
   
   pid=$(cat $PIDFILE)
  +
  +if [ ! -e /proc/$pid ]; then
  +  echo "$(date): rep process not running"
  +  echo 0 >&3
  +  exit 0
  +fi
   
   if evacuate; then
     echo "$(date): drain triggered"
  
positive.code: LOGFILE=$LOG_DIR/drain.log
  ADDRESS=<%= p("diego.rep.listen_addr").sub(/^0\.0\.0\.0:/, "localhost:") %>
  
  exec 3>&1
  
  exec 1>> $LOGFILE
  exec 2>> $LOGFILE
  
negative.code:   curl --fail --silent http://$ADDRESS/ping >/dev/null 2>&1
  }
  
  if [ ! -f $PIDFILE ]; then
    echo "$(date): PIDFILE does not exist"
    echo 0 >&3
  