anchor.diff:  }
   
   prepare_for_upgrade () {
  -  echo "$("${TIMESTAMP}"): Preparing RabbitMQ for potential upgrade" >> "${INIT_LOG_DIR}/startup_stdout.log"
  +  __log ${STARTUP_LOG} "Preparing RabbitMQ for potential upgrade"
     for remote_node in $(cat /var/vcap/data/upgrade_preparation_nodes); do
       /var/vcap/packages/rabbitmq-upgrade-preparation/bin/rabbitmq-upgrade-preparation \
         -rabbitmqctl-path $CONTROL \
         -node $remote_node \
         -new-rabbitmq-version $(cat ${RMQ_SERVER_PACKAGE}/rmq_version) \
         -new-erlang-version $(cat ${RMQ_SERVER_PACKAGE}/erlang_version) \
  -      1>> "${INIT_LOG_DIR}/startup_stdout.log" \
  -      2>> "${INIT_LOG_DIR}/startup_stderr.log"
  +      1>> "${STARTUP_LOG}" \
  +      2>> "${STARTUP_ERR_LOG}"
     done
   }
   
   start_rabbitmq () {
  +    ensure_dirs
  +    ensure_log_files
       status_rabbitmq
       if [ "${RETVAL}" = 0 ]; then
  -      echo "RabbitMQ is currently running" | tee -a "${INIT_LOG_DIR}/startup_stdout.log"
  +        __log ${STARTUP_LOG} "RabbitMQ is currently running"
       else
           RETVAL=0
  -        ensure_dirs
  -        ensure_log_files
           run_script "${JOB_DIR}/bin/setup.sh"
           run_script "${JOB_DIR}/bin/plugins.sh"
           prepare_for_upgrade
  -        echo "$("${TIMESTAMP}"): Starting RabbitMQ" >> "${INIT_LOG_DIR}/startup_stdout.log"
  +        __log ${STARTUP_LOG} "Starting RabbitMQ"
           RABBITMQ_PID_FILE="${PID_FILE}" "${START_PROG}" "${DAEMON}" \
  -            >> "${INIT_LOG_DIR}/startup_stdout.log" \
  -            2>> "${INIT_LOG_DIR}/startup_stderr.log" \
  +            >> "${STARTUP_LOG}" \
  +            2>> "${STARTUP_ERR_LOG}" \
               0<&- &
           set +e
  -        "${CONTROL}" wait "${PID_FILE}" >/dev/null 2>&1
  +        "${CONTROL}" wait "${PID_FILE}" > "${STARTUP_LOG}" 2> "${STARTUP_ERR_LOG}"
           RETVAL=$?
           set -e
           case "${RETVAL}" in
  
positive.code: }
  
  ensure_log_files() {
    touch "${INIT_LOG_DIR}"/startup_stdout.log
    touch "${INIT_LOG_DIR}"/startup_stderr.log
    touch "${INIT_LOG_DIR}"/shutdown_log
    touch "${INIT_LOG_DIR}"/shutdown_err
    chown vcap:vcap "${INIT_LOG_DIR}"/startup*
    chown vcap:vcap "${INIT_LOG_DIR}"/shutdown*
  }
  
negative.code: RETVAL=0
  
  [ -f "/var/vcap/store/rabbitmq/etc/default/${NAME}" ] && . "/var/vcap/store/rabbitmq/etc/default/${NAME}"
  
  __log() {
    MESSAGE="$("${TIMESTAMP}"): $2"
    echo "${MESSAGE}"
    echo "${MESSAGE}" >> ${1}
  }
  
  ensure_dir() {
      DIR=$1
  