[ 
https://issues.apache.org/jira/browse/KAFKA-1081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13791819#comment-13791819
 ] 

Francois Saint-Jacques commented on KAFKA-1081:
-----------------------------------------------

Look for the 3 last lines, not the usage error.

$ cd /
$ /opt/kafka/bin/kafka-list-topic.sh
Missing required argument "[zookeeper]"
Option                                  Description
------                                  -----------
--topic <topic>                         REQUIRED: The topic to be listed.
                                          Defaults to all existing topics.
                                          (default: )
--unavailable-partitions                if set, only show partitions whose
                                          leader is not available
--under-replicated-partitions           if set, only show under replicated
                                          partitions
--zookeeper <urls>                      REQUIRED: The connection string for
                                          the zookeeper connection in the form
                                          host:port. Multiple URLS can be
                                          given to allow fail-over.
/opt/kafka/bin/kafka-run-class.sh: line 72: exception.txt: Permission denied
cat: exception.txt: No such file or directory
rm: cannot remove 'exception.txt': No such file or directory

> kafka-run-class.sh is broken
> ----------------------------
>
>                 Key: KAFKA-1081
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1081
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.8
>            Reporter: Francois Saint-Jacques
>
> Please apply this patch, this is why log4j exists. Rerunning at 
> non-deterministic command twice to catch error message is extremely dangerous.
> diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
> index eb6ff1b..2f2d8b5 100755
> --- a/bin/kafka-run-class.sh
> +++ b/bin/kafka-run-class.sh
> @@ -102,19 +102,3 @@ if [ "$1" = "daemon" ] && [ -z "$KAFKA_GC_LOG_OPTS"] ; 
> then
>  fi
>  $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS 
> $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@"
> -
> -exitval=$?
> -
> -if [ $exitval -eq "1" ] ; then
> -       $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS 
> $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@" >& 
> exception.txt
> -       exception=`cat exception.txt`
> -       noBuildMessage='Please build the project using sbt. Documentation is 
> available at http://kafka.apache.org/'
> -       pattern="(Could not find or load main 
> class)|(java\.lang\.NoClassDefFoundError)"
> -       match=`echo $exception | grep -E "$pattern"`
> -       if [[ -n "$match" ]]; then
> -               echo $noBuildMessage
> -       fi
> -       rm exception.txt
> -fi
> -
> -



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to