Skip to content

Commit c29d475

Browse files
use socat instead of nc (pravega#476)
Signed-off-by: Alfred Landrum <[email protected]> Signed-off-by: Alfred Landrum <[email protected]> Co-authored-by: anishakj <[email protected]>
1 parent ae23010 commit c29d475

5 files changed

+5
-5
lines changed

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ RUN chmod +x /usr/local/bin/*
2121
COPY --from=0 /zu/build/libs/zu.jar /opt/libs/
2222

2323
RUN apt-get -q update && \
24-
apt-get install -y dnsutils curl procps
24+
apt-get install -y dnsutils curl procps socat

docker/bin/zookeeperLive.sh

+1-1
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ MYID_FILE=$DATA_DIR/myid
2020
LOG4J_CONF=/conf/log4j-quiet.properties
2121
STATIC_CONFIG=/data/conf/zoo.cfg
2222

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

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

docker/bin/zookeeperTeardown.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LOG4J_CONF=/conf/log4j-quiet.properties
2121
# Wait for client connections to drain. Kubernetes will wait until the confiugred
2222
# "terminationGracePeriodSeconds" before focibly killing the container
2323
for (( i = 0; i < 6; i++ )); do
24-
CONN_COUNT=`echo cons | nc localhost 2181 | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l`
24+
CONN_COUNT=`echo cons | socat stdio tcp:localhost:$CLIENT_PORT | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l`
2525
if [[ "$CONN_COUNT" -gt 0 ]]; then
2626
echo "$CONN_COUNT non-local connections still connected."
2727
sleep 5

0 commit comments

Comments
 (0)