Skip to content
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

Issue 475: use socat instead of nc #476

Merged
merged 4 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN chmod +x /usr/local/bin/*
COPY --from=0 /zu/build/libs/zu.jar /opt/libs/

RUN apt-get -q update && \
apt-get install -y dnsutils curl procps
apt-get install -y dnsutils curl procps socat
2 changes: 1 addition & 1 deletion docker/bin/zookeeperLive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -ex

source /conf/env.sh

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

# Check to see if zookeeper service answers
if [[ "$OK" == "imok" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/bin/zookeeperMetrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ set -ex

source /conf/env.sh

echo mntr | nc localhost $CLIENT_PORT >& 1
echo mntr | socat stdio tcp:localhost:$CLIENT_PORT >& 1
2 changes: 1 addition & 1 deletion docker/bin/zookeeperReady.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MYID_FILE=$DATA_DIR/myid
LOG4J_CONF=/conf/log4j-quiet.properties
STATIC_CONFIG=/data/conf/zoo.cfg

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

# Check to see if zookeeper service answers
if [[ "$OK" == "imok" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/bin/zookeeperTeardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LOG4J_CONF=/conf/log4j-quiet.properties
# Wait for client connections to drain. Kubernetes will wait until the confiugred
# "terminationGracePeriodSeconds" before focibly killing the container
for (( i = 0; i < 6; i++ )); do
CONN_COUNT=`echo cons | nc localhost 2181 | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l`
CONN_COUNT=`echo cons | socat stdio tcp:localhost:$CLIENT_PORT | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l`
if [[ "$CONN_COUNT" -gt 0 ]]; then
echo "$CONN_COUNT non-local connections still connected."
sleep 5
Expand Down