anchor.diff:  
   LOGNAME=/var/log/opscode/keepalived/cluster.log
   PROGNAME=$(basename $0)
  +
  +# must be longer than unicorn 60 second timeout
  +export SVWAIT=30
  +
  +# touching the terminate_master_file will abort a stuck master transition
  +# (if you know it will never be able to grab the drbd primary cluster 'lock')
  +terminate_master_file=/var/opt/opscode/keepalived/terminate_master
  +requested_state_file=/var/opt/opscode/keepalived/requested_cluster_status
  +current_state_file=/var/opt/opscode/keepalived/current_cluster_status
  +lockfile=/var/opt/opscode/keepalived/cluster-transition.lock
   
   function log_me
   {
  
positive.code:   trap - INT TERM EXIT
  }
  
  # must be longer than unicorn 60 second timeout
  export SVWAIT=30
  
  requested_state_file=/var/opt/opscode/keepalived/requested_cluster_status
  current_state_file=/var/opt/opscode/keepalived/current_cluster_status
  echo $1 > $requested_state_file
  
  lockfile=/var/opt/opscode/keepalived/cluster-transition.lock
  if lock $lockfile; then
     transition "$1"
     log_me "Transitioned to $1"
     transitioned_to=$1
  
negative.code:    done
     unlock $lockfile 
     echo $1 > $current_state_file
  }
  
  echo $1 > $requested_state_file
  
  try=10
  while true; do
    if lock $lockfile; then
       transition_loop "$1"
       break
    else
       log_me "Requested transition to $1"
       if [ "$1" != "backup" ]; then
         error_exit "Requested transition to $1, but state transition already running."
         break
       fi
       log_me "Attempting to interrupt previously running state transition."
       touch $terminate_master_file
       sleep 1
    fi
  done
  
  exit 0
  