[
https://issues.apache.org/jira/browse/KAFKA-4566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885503#comment-17885503
]
Alex Russell edited comment on KAFKA-4566 at 10/1/24 3:53 PM:
--------------------------------------------------------------
[~ecomar], I've branched trunk, replaced $(dirname $0) with $(dirname
"$(readlink -f "$0")") in all cases. There were a couple of exceptions where we
set dirname as a variable higher-up in the wrapper that calls
kafka-run-class.sh and then use dirname directly in the final exec, so in
two-or-three places I've updated the final exec to use $(dirname "$(readlink..
as opposed to $basedir directly. I used a search-and-replace on each file, and
as I'm not experienced in using each-and-every bin script I've simply tested
"Running a Kafka broker in KRaft Mode" as-per readme.md. I've done this via
./gradlew releaseTarGz (on Mac) and unzipped to the local filesystem. I've also
tested this having copied the scripts into the container (via mounted volume).
Will this be sufficient to make a pull request? Are there any tests that
exercise every bin/*.sh?
was (Author: JIRAUSER307110):
[~ecomar], I've branched trunk, replaced $(dirname $0) with $(dirname
"$(readlink "$0")") in all cases. There were a couple of exceptions where we
set dirname as a variable higher-up in the wrapper that calls
kafka-run-class.sh and then use dirname directly in the final exec, so in
two-or-three places I've updated the final exec to use $(dirname "$(readlink..
as opposed to $basedir directly. I used a search-and-replace on each file, and
as I'm not experienced in using each-and-every bin script I've simply tested
"Running a Kafka broker in KRaft Mode" as-per readme.md. I've done this via
./gradlew releaseTarGz (on Mac) and unzipped to the local filesystem. I've also
tested this having copied the scripts into the container (via mounted volume).
Will this be sufficient to make a pull request? Are there any tests that
exercise every bin/*.sh?
> Can't Symlink to Kafka bins
> ---------------------------
>
> Key: KAFKA-4566
> URL: https://issues.apache.org/jira/browse/KAFKA-4566
> Project: Kafka
> Issue Type: Bug
> Components: tools
> Affects Versions: 0.10.1.1
> Reporter: Stephane Maarek
> Assignee: Akhilesh Naidu
> Priority: Major
> Labels: newbie
>
> in the kafka consumer for example, the last line is :
> https://github.com/apache/kafka/blob/trunk/bin/kafka-console-consumer.sh#L21
> {code}
> exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsoleConsumer "$@"
> {code}
> if I create a symlink using
> {code}
> ln -s
> {code}
> it doesn't resolve the right directory name because of $(dirname $0)
> I believe the right way is to do:
> {code}
> "$(dirname "$(readlink -e "$0")")"
> {code}
>
> Any thoughts on that before I do a PR?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)