From 65f96e3bb5c7a6abb91f44af467018bfa4397f8c Mon Sep 17 00:00:00 2001 From: Tarun Pothulapati Date: Wed, 4 Sep 2024 20:04:35 +0530 Subject: [PATCH] fix(docker/healthcheck): run netstat port retreival command as dfly (#3647) * fix(docker/healthcheck): run netstat port retreival command as dfly --- tools/docker/healthcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/healthcheck.sh b/tools/docker/healthcheck.sh index de5e219fb..c6c385a8d 100755 --- a/tools/docker/healthcheck.sh +++ b/tools/docker/healthcheck.sh @@ -6,7 +6,7 @@ PORT=$HEALTHCHECK_PORT if [ -z "$HEALTHCHECK_PORT" ]; then # check all the TCP listening sockets, filter the dragonfly process, and fetch the port. # For cases when dragonfly opens multiple ports, we filter with tail to choose one of them. - PORT=$(netstat -tlnp | grep "1/dragonfly" | grep -oE ':[0-9]+' | cut -c2- | tail -n 1) + PORT=$(su dfly -c "netstat -tlnp" | grep "1/dragonfly" | grep -oE ':[0-9]+' | cut -c2- | tail -n 1) fi # If we're running with TLS enabled, utilise OpenSSL for the check