Skip to content
Merged
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
13 changes: 4 additions & 9 deletions core/docker/bin/run-trino
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

set -xeuo pipefail

set +e
grep -s -q 'node.id' /etc/trino/node.properties
NODE_ID_EXISTS=$?
set -e

NODE_ID=""
if [[ ${NODE_ID_EXISTS} != 0 ]] ; then
NODE_ID="-Dnode.id=${HOSTNAME}"
launcher_opts=(--etc-dir /etc/trino)
if ! grep -s -q 'node.id' /etc/trino/node.properties; then
launcher_opts+=("-Dnode.id=${HOSTNAME}")
fi

exec /usr/lib/trino/bin/launcher run --etc-dir /etc/trino ${NODE_ID} "$@"
exec /usr/lib/trino/bin/launcher run "${launcher_opts[@]}" "$@"