Skip to content

Commit

Permalink
Merge branch '3.6-dev' into 3.7-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazcy committed Dec 19, 2023
2 parents 90c1ae3 + 1e10331 commit 3a51214
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gremlin-server/src/main/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@
set -e

CONF_FILE=$1
GREMLIN_SERVER=/opt/gremlin-server/bin/gremlin-server.sh

# IP substitution hack borrowed from:
# https://github.com/htaox/NEAT/blob/94a004831cf89767e116d955192fc14ac82e5069/docker-scripts/gremlin-server-3.0.0/files/default_cmd#L5
IP=$(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }')
sed -i "s|^host:.*|host: $IP|" $CONF_FILE

exec /opt/gremlin-server/bin/gremlin-server.sh "$@"
handler()
{
kill -s SIGINT "$PID"
}

exec $GREMLIN_SERVER "$@" &
PID=$(ps | grep -w $GREMLIN_SERVER | grep -v grep | awk 'NR==1 {print $1}')
trap 'handler $PID' SIGTERM
wait "$PID"

0 comments on commit 3a51214

Please sign in to comment.