anchor.diff:  fi
   
   catalina_sh() {
  -  $DAEMON_TOMEE $1
  -	status="$?"
  -	set +a -e
  -	return $status
  +  if [ 'stop' = $1 ]; then
  +    if [ -s /opt/tomee/logs/catalina-daemon.pid ]; then
  +      $DAEMON_TOMEE $1
  +    else
  +      echo "Warning file /opt/tomee/logs/catalina-daemon.pid empty. Already stopped?"
  +    fi
  +  else
  +    $DAEMON_TOMEE $1
  +  fi
  +  status="$?"
  +  set +a -e
  +  return $status
   }
   
   case "$1" in
     start)
   	if [ -z "$JAVA_HOME" ]; then
  -		log_failure_msg "no JDK or JRE found - please set JAVA_HOME"
  +		echo "no JDK or JRE found - please set JAVA_HOME"
   		exit 1
   	fi
   
   	if [ ! -d "$CATALINA_BASE/conf" ]; then
  -		log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE"
  +		echo "invalid CATALINA_BASE: $CATALINA_BASE"
   		exit 1
   	fi
   
  -	  log_daemon_msg "Starting $DESC" "$NAME"
  +	 echo "Starting $DESC" "$NAME"
      set +e
      catalina_sh start
      set -e
   	;;
     stop)
  -	  log_daemon_msg "Stopping $DESC" "$NAME"
  +	echo "Stopping $DESC" "$NAME"
   
   	set +e
     catalina_sh stop
  -	log_end_msg 0
   	set -e
   	;;
      status)
  
positive.code: fi
  
  if [ ! -d "$CATALINA_BASE/conf" ]; then
    log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE"
    exit 1
  fi
  
  if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then
  	log_failure_msg "$NAME is not installed"
  	exit 1
  fi
  
  
negative.code:     set -e
          ;;
    *)
  	echo "Usage: $0 {start|stop|restart|force-reload|status}"
  	exit 1
  	;;
  esac
  