diff --git a/bin/kafka-console-consumer.sh b/bin/kafka-console-consumer.sh index 95edc9e5bff..b86ea56c5c0 100755 --- a/bin/kafka-console-consumer.sh +++ b/bin/kafka-console-consumer.sh @@ -15,4 +15,4 @@ # limitations under the License. export KAFKA_HEAP_OPTS="-Xmx512M" -$(dirname $0)/kafka-run-class.sh kafka.consumer.ConsoleConsumer $@ +exec $(dirname $0)/kafka-run-class.sh kafka.consumer.ConsoleConsumer $@ diff --git a/bin/kafka-console-producer.sh b/bin/kafka-console-producer.sh index f102c2239a5..ec0f21f9a2e 100755 --- a/bin/kafka-console-producer.sh +++ b/bin/kafka-console-producer.sh @@ -15,4 +15,4 @@ # limitations under the License. export KAFKA_HEAP_OPTS="-Xmx512M" -$(dirname $0)/kafka-run-class.sh kafka.producer.ConsoleProducer $@ +exec $(dirname $0)/kafka-run-class.sh kafka.producer.ConsoleProducer $@ diff --git a/bin/kafka-consumer-perf-test.sh b/bin/kafka-consumer-perf-test.sh index 39434d162e5..38c56c78304 100755 --- a/bin/kafka-consumer-perf-test.sh +++ b/bin/kafka-consumer-perf-test.sh @@ -15,4 +15,4 @@ # limitations under the License. export KAFKA_HEAP_OPTS="-Xmx512M" -$(dirname $0)/kafka-run-class.sh kafka.perf.ConsumerPerformance $@ +exec $(dirname $0)/kafka-run-class.sh kafka.perf.ConsumerPerformance $@ diff --git a/bin/kafka-preferred-replica-election.sh b/bin/kafka-preferred-replica-election.sh index 6416dc16140..ed167c26ce9 100755 --- a/bin/kafka-preferred-replica-election.sh +++ b/bin/kafka-preferred-replica-election.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(dirname $0)/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand $@ +exec $(dirname $0)/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand $@ diff --git a/bin/kafka-producer-perf-test.sh b/bin/kafka-producer-perf-test.sh index 1935522079c..d75ab7d1f30 100755 --- a/bin/kafka-producer-perf-test.sh +++ b/bin/kafka-producer-perf-test.sh @@ -15,4 +15,4 @@ # limitations under the License. export KAFKA_HEAP_OPTS="-Xmx512M" -$(dirname $0)/kafka-run-class.sh kafka.perf.ProducerPerformance $@ +exec $(dirname $0)/kafka-run-class.sh kafka.perf.ProducerPerformance $@ diff --git a/bin/kafka-reassign-partitions.sh b/bin/kafka-reassign-partitions.sh index a6bd148752b..95b4ae0e4f0 100755 --- a/bin/kafka-reassign-partitions.sh +++ b/bin/kafka-reassign-partitions.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(dirname $0)/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand $@ +exec $(dirname $0)/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand $@ diff --git a/bin/kafka-replay-log-producer.sh b/bin/kafka-replay-log-producer.sh index 86943eed22e..8e2e7139f71 100755 --- a/bin/kafka-replay-log-producer.sh +++ b/bin/kafka-replay-log-producer.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(dirname $0)/kafka-run-class.sh kafka.tools.ReplayLogProducer $@ +exec $(dirname $0)/kafka-run-class.sh kafka.tools.ReplayLogProducer $@ diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh index eb6ff1b12e5..2ef75e49d28 100755 --- a/bin/kafka-run-class.sh +++ b/bin/kafka-run-class.sh @@ -88,7 +88,7 @@ fi # JVM performance options if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then - KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseCompressedOops -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC" + KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseCompressedOops -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC -Djava.awt.headless=true" fi # GC options @@ -101,20 +101,6 @@ if [ "$1" = "daemon" ] && [ -z "$KAFKA_GC_LOG_OPTS"] ; then KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps " 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 +exec $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@" diff --git a/bin/kafka-server-start.sh b/bin/kafka-server-start.sh index 4005289428d..4a36b2d97af 100755 --- a/bin/kafka-server-start.sh +++ b/bin/kafka-server-start.sh @@ -22,4 +22,4 @@ fi base_dir=$(dirname $0) export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" -$base_dir/kafka-run-class.sh daemon kafkaServer kafka.Kafka $@ +exec $base_dir/kafka-run-class.sh daemon kafkaServer kafka.Kafka $@ diff --git a/bin/kafka-simple-consumer-perf-test.sh b/bin/kafka-simple-consumer-perf-test.sh index 94c9ed0bfc2..c466cc8886a 100755 --- a/bin/kafka-simple-consumer-perf-test.sh +++ b/bin/kafka-simple-consumer-perf-test.sh @@ -15,4 +15,4 @@ # limitations under the License. export KAFKA_HEAP_OPTS="-Xmx512M" -$(dirname $0)/kafka-run-class.sh kafka.perf.SimpleConsumerPerformance $@ +exec $(dirname $0)/kafka-run-class.sh kafka.perf.SimpleConsumerPerformance $@ diff --git a/bin/kafka-simple-consumer-shell.sh b/bin/kafka-simple-consumer-shell.sh index 8d69357838f..9316f7908df 100755 --- a/bin/kafka-simple-consumer-shell.sh +++ b/bin/kafka-simple-consumer-shell.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(dirname $0)/kafka-run-class.sh kafka.tools.SimpleConsumerShell $@ +exec $(dirname $0)/kafka-run-class.sh kafka.tools.SimpleConsumerShell $@ diff --git a/bin/kafka-topics.sh b/bin/kafka-topics.sh index cb76590c269..b39b2729170 100755 --- a/bin/kafka-topics.sh +++ b/bin/kafka-topics.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(dirname $0)/kafka-run-class.sh kafka.admin.TopicCommand $@ +exec $(dirname $0)/kafka-run-class.sh kafka.admin.TopicCommand $@ diff --git a/bin/zookeeper-server-start.sh b/bin/zookeeper-server-start.sh index e4746a84b3b..cdbbf33886d 100755 --- a/bin/zookeeper-server-start.sh +++ b/bin/zookeeper-server-start.sh @@ -22,5 +22,5 @@ fi base_dir=$(dirname $0) export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" export KAFKA_HEAP_OPTS="-Xmx512M -Xms512M" -$base_dir/kafka-run-class.sh daemon zookeeper org.apache.zookeeper.server.quorum.QuorumPeerMain $@ +exec $base_dir/kafka-run-class.sh daemon zookeeper org.apache.zookeeper.server.quorum.QuorumPeerMain $@ diff --git a/bin/zookeeper-shell.sh b/bin/zookeeper-shell.sh index e0de33f2e16..92cce7600ef 100755 --- a/bin/zookeeper-shell.sh +++ b/bin/zookeeper-shell.sh @@ -20,4 +20,4 @@ then exit 1 fi -$(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server $1 \ No newline at end of file +exec $(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server $1 \ No newline at end of file