ZOOKEEPER-4985 Fix zkCleanup.sh script to not fail on non-standard config directories
https://issues.apache.org/jira/browse/ZOOKEEPER-4985
The zkCleanup.sh script has several issues that make it difficult to use in containerized or non-standard deployments:
The script hardcodes the path to zoo.cfg and fails with confusing error messages when the config file is not in the default location. When the config file is missing, it passes empty strings to PurgeTxnLog, causing confusing error messages
Steps to Reproduce:
- Run ZooKeeper with config in a non-standard location (e.g., /custom/path/zoo.cfg)
- Try to run cleanup:
grep: /path/to/zookeeper/bin/../conf/zoo.cfg: No such file or directory
grep: /path/to/zookeeper/bin/../conf/zoo.cfg: No such file or directory
Path '/path/to/zookeeper/bin' does not exist.
Usage:
PurgeTxnLog dataLogDir [snapDir] -n count
The shellcheck failures were there before already.
The shellcheck failures were there before already.
I don't think that's true. I think it is caused by removing the shellcheck file hints. I just ran the tools/ci/run-shellcheck.sh script on the current master branch, and it succeeds. So, I think the failure was added in this PR.
Thank you for the review. I'd like to claim it was late and I was tired but looking at the timestamp that wasn't the case. Sorry for the extra work. I believe I addressed all of your comments.