[
https://issues.apache.org/jira/browse/KAFKA-3742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15415116#comment-15415116
]
ASF GitHub Bot commented on KAFKA-3742:
---------------------------------------
GitHub user 1ambda opened a pull request:
https://github.com/apache/kafka/pull/1717
KAFKA-3742: Can't run bin/connect-*.sh with -daemon flag
## Problem
Current connect scripts (`connect-distributed.sh`, `connect-standalone.sh`)
do not support `-daemon` flag even if users specify the flag
since `kafka-run-class.sh` requires that the`-daemon` flag should precede
other arguments (e.g. class name)
## Solution
Do the same thing like `kafka-server-start.sh`
- Parse a command
- Add `-daemon` to `$EXTRA_ARGS` if exists
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/1ambda/kafka
KAFKA-3742-connect-running-as-daemon
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/1717.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1717
----
commit cecc8578fdb178630f5918fd4de47c556e13b286
Author: 1ambda <[email protected]>
Date: 2016-08-10T10:52:15Z
Support ''-daemon' in connect-*.sh
----
> Can't run connect-distributed.sh with -daemon flag
> --------------------------------------------------
>
> Key: KAFKA-3742
> URL: https://issues.apache.org/jira/browse/KAFKA-3742
> Project: Kafka
> Issue Type: Bug
> Components: KafkaConnect
> Affects Versions: 0.10.0.0
> Reporter: Geoff Anderson
> Assignee: Liquan Pei
> Priority: Minor
>
> Running on ubuntu 14.04. Discovered while experimenting various different
> kafka components.
> This error probably applies to other scripts as well.
> Running connect-distributed.sh thusly
> {code}connect-distributed.sh -daemon /tmp/connect-distributed.properties{code}
> gives errors like this
> {code}
> root@worker1:/home/vagrant# connect-distributed.sh -daemon
> /tmp/connect-distributed.properties
> Exception in thread "main" java.io.FileNotFoundException: -daemon (No such
> file or directory)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:146)
> at java.io.FileInputStream.<init>(FileInputStream.java:101)
> at org.apache.kafka.common.utils.Utils.loadProps(Utils.java:446)
> at
> org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:61)
> {code}
> Note that this runs:
> connect-distributed.sh /tmp/connect-distributed.properties -daemon
> However, the daemon flag is not activated in this case
> Underlying cause:
> kafka-run-class.sh assumes -daemon comes before the classpath
> The scripts for which -daemon works use something like
> {code}
> EXTRA_ARGS="-name kafkaServer -loggc"
> COMMAND=$1
> case $COMMAND in
> -daemon)
> EXTRA_ARGS="-daemon "$EXTRA_ARGS
> shift
> ;;
> *)
> ;;
> esac
> exec $base_dir/kafka-run-class.sh $EXTRA_ARGS
> io.confluent.support.metrics.SupportedKafka "$@"
> {code}
> but connect-distributed does this:
> {code}
> exec $(dirname $0)/kafka-run-class.sh
> org.apache.kafka.connect.cli.ConnectDistributed "$@"
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)