1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

fix(docker/healthcheck): run netstat port retreival command as dfly (#3647)

* fix(docker/healthcheck): run netstat port retreival command as dfly
This commit is contained in:
Tarun Pothulapati 2024-09-04 20:04:35 +05:30 committed by Roman Gershman
parent 64faf87f40
commit e260ebf561
No known key found for this signature in database
GPG key ID: F25B77EAF8AEBA7A

View file

@ -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