[FLINK-8827] [scripts] When FLINK_CONF_DIR contains spaces, ZooKeeper related scripts fail
This closes #5614 Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/af9a68c5 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/af9a68c5 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/af9a68c5 Branch: refs/heads/release-1.5 Commit: af9a68c5af85feb51de5cac735de1473f008f0fe Parents: 969909b Author: davidxdh <xu.dong...@zte.com.cn> Authored: Fri Mar 2 10:55:23 2018 +0800 Committer: Stephan Ewen <se...@apache.org> Committed: Wed Mar 7 21:28:13 2018 +0100 ---------------------------------------------------------------------- flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh | 6 +++--- flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh | 6 +++--- flink-dist/src/main/flink-bin/bin/zookeeper.sh | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/af9a68c5/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh ---------------------------------------------------------------------- diff --git a/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh b/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh index cc8917b..d5a7593 100755 --- a/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh +++ b/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh @@ -24,8 +24,8 @@ bin=`cd "$bin"; pwd` # Starts a ZooKeeper quorum as configured in $FLINK_CONF/zoo.cfg -ZK_CONF=$FLINK_CONF_DIR/zoo.cfg -if [ ! -f $ZK_CONF ]; then +ZK_CONF="$FLINK_CONF_DIR/zoo.cfg" +if [ ! -f "$ZK_CONF" ]; then echo "[ERROR] No ZooKeeper configuration file found in '$ZK_CONF'." exit 1 fi @@ -43,4 +43,4 @@ while read server ; do else echo "[WARN] Parse error. Skipping config entry '$server'." fi -done < <(grep "^server\." $ZK_CONF) +done < <(grep "^server\." "$ZK_CONF") http://git-wip-us.apache.org/repos/asf/flink/blob/af9a68c5/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh ---------------------------------------------------------------------- diff --git a/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh b/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh index 29ddae4..ad79de8 100755 --- a/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh +++ b/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh @@ -24,8 +24,8 @@ bin=`cd "$bin"; pwd` # Stops a ZooKeeper quorum as configured in $FLINK_CONF/zoo.cfg -ZK_CONF=$FLINK_CONF_DIR/zoo.cfg -if [ ! -f $ZK_CONF ]; then +ZK_CONF="$FLINK_CONF_DIR/zoo.cfg" +if [ ! -f "$ZK_CONF" ]; then echo "[ERROR] No ZooKeeper configuration file found in '$ZK_CONF'." exit 1 fi @@ -43,4 +43,4 @@ while read server ; do else echo "[WARN] Parse error. Skipping config entry '$server'." fi -done < <(grep "^server\." $ZK_CONF) +done < <(grep "^server\." "$ZK_CONF") http://git-wip-us.apache.org/repos/asf/flink/blob/af9a68c5/flink-dist/src/main/flink-bin/bin/zookeeper.sh ---------------------------------------------------------------------- diff --git a/flink-dist/src/main/flink-bin/bin/zookeeper.sh b/flink-dist/src/main/flink-bin/bin/zookeeper.sh index ca72bb7..53d7098 100755 --- a/flink-dist/src/main/flink-bin/bin/zookeeper.sh +++ b/flink-dist/src/main/flink-bin/bin/zookeeper.sh @@ -33,8 +33,8 @@ bin=`cd "$bin"; pwd` . "$bin"/config.sh -ZK_CONF=$FLINK_CONF_DIR/zoo.cfg -if [ ! -f $ZK_CONF ]; then +ZK_CONF="$FLINK_CONF_DIR/zoo.cfg" +if [ ! -f "$ZK_CONF" ]; then echo "[ERROR] No ZooKeeper configuration file found in '$ZK_CONF'." exit 1 fi