-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ZOOKEEPER-4985 Fix zkCleanup.sh script to not fail on non-standard config directories #2324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
d4c905f
6931054
237f5b7
fb5eb34
63b2e59
e31a646
d4b8d01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,27 +31,44 @@ | |||||
| # use POSIX interface, symlink is followed automatically | ||||||
| ZOOBIN="${BASH_SOURCE-$0}" | ||||||
| ZOOBIN="$(dirname "$ZOOBIN")" | ||||||
| ZOOBINDIR="$(cd "$ZOOBIN" && pwd)" | ||||||
| ZOOBINDIR="$(cd "$ZOOBIN" || exit && pwd)" | ||||||
|
|
||||||
| if [[ -e "$ZOOBIN/../libexec/zkEnv.sh" ]]; then | ||||||
| # shellcheck source=bin/zkEnv.sh | ||||||
ctubbsii marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| . "$ZOOBINDIR"/../libexec/zkEnv.sh | ||||||
| . "$ZOOBINDIR"/../libexec/zkEnv.sh "$@" | ||||||
| else | ||||||
| # shellcheck source=bin/zkEnv.sh | ||||||
| . "$ZOOBINDIR"/zkEnv.sh | ||||||
| . "$ZOOBINDIR"/zkEnv.sh "$@" | ||||||
| fi | ||||||
|
|
||||||
| ZOODATADIR="$(grep "^[[:space:]]*dataDir=" "$ZOOCFG" | sed -e 's/.*=//')" | ||||||
| ZOODATALOGDIR="$(grep "^[[:space:]]*dataLogDir=" "$ZOOCFG" | sed -e 's/.*=//')" | ||||||
| ZOODATADIR="" | ||||||
| ZOODATALOGDIR="" | ||||||
|
|
||||||
| # Only try to read config if ZOOCFG exists | ||||||
| if [[ -f $ZOOCFG ]]; then | ||||||
| ZOODATADIR="$(grep "^[[:space:]]*dataDir=" "$ZOOCFG" 2>/dev/null | sed -e 's/.*=//')" | ||||||
| ZOODATALOGDIR="$(grep "^[[:space:]]*dataLogDir=" "$ZOOCFG" 2>/dev/null | sed -e 's/.*=//')" | ||||||
|
||||||
| fi | ||||||
|
|
||||||
| ZOO_LOG_FILE=zookeeper-$USER-cleanup-$HOSTNAME.log | ||||||
|
|
||||||
| # shellcheck disable=SC2206 | ||||||
| flags=($JVMFLAGS) | ||||||
|
||||||
| flags=($JVMFLAGS) | |
| flags=("-Dzookeeper.log.dir=$ZOO_LOG_DIR" "-Dzookeeper.log.file=$ZOO_LOG_FILE" $JVMFLAGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed manually (see below for a reason why) in 63b2e59 (this PR)
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLASSPATH environment variable is already exported. Passing it again as -cp $CLASSPATH is redundant, and makes really really long output in ps, and sometimes breaks the ability to use pkill or pgrep on the process, due to the length of the command-line. It is enough to export the variable. You don't need -cp.
(Same comment applies in the other cases where you've added it, as well.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I honestly can't remember why I did this. I just assume it was a remnant from debugging the issue.
Uh oh!
There was an error while loading. Please reload this page.