Skip to content

Commit 85e5398

Browse files
committed
Issue 475: use socat instead of nc
1 parent 526abf0 commit 85e5398

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ RUN chmod +x /usr/local/bin/*
2323
COPY --from=0 /zu/build/libs/zu.jar /opt/libs/
2424

2525
RUN apt-get -q update && \
26-
apt-get install --no-install-recommends -y curl dnsutils procps
26+
apt-get install --no-install-recommends -y curl dnsutils procps socat

docker/bin/zookeeperLive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -ex
1313

1414
source /conf/env.sh
1515

16-
OK=$(echo ruok | nc 127.0.0.1 $CLIENT_PORT)
16+
OK=$(echo ruok | socat stdio tcp:localhost:$CLIENT_PORT)
1717

1818
# Check to see if zookeeper service answers
1919
if [[ "$OK" == "imok" ]]; then

docker/bin/zookeeperMetrics.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ set -ex
1313

1414
source /conf/env.sh
1515

16-
echo mntr | nc localhost $CLIENT_PORT >& 1
16+
echo mntr | socat stdio tcp:localhost:$CLIENT_PORT >& 1

docker/bin/zookeeperReady.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ OFFSET=${OFFSET:-1}
2828
CLIENT_HOST=${SEED_NODE:-$CLIENT_HOST}
2929

3030

31-
OK=$(echo ruok | nc 127.0.0.1 $CLIENT_PORT)
31+
OK=$(echo ruok | socat stdio tcp:localhost:$CLIENT_PORT)
3232

3333
# Check to see if zookeeper service answers
3434
if [[ "$OK" == "imok" ]]; then

docker/bin/zookeeperTeardown.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ OFFSET=${OFFSET:-1}
2828
# Wait for client connections to drain. Kubernetes will wait until the confiugred
2929
# "terminationGracePeriodSeconds" before focibly killing the container
3030
for (( i = 0; i < 6; i++ )); do
31-
CONN_COUNT=`echo cons | nc localhost 2181 | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l`
31+
CONN_COUNT=`echo cons | socat stdio tcp:localhost:$CLIENT_PORT | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l`
3232
if [[ "$CONN_COUNT" -gt 0 ]]; then
3333
echo "$CONN_COUNT non-local connections still connected."
3434
sleep 5

0 commit comments

Comments
 (0)