From 76ae32997af66a8ce1db634da7e388ee1584de08 Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Fri, 2 Feb 2024 09:01:30 +0100 Subject: [PATCH] check port at the last moment --- tools/genenotebook/launch_gnb.sh | 6 ++++-- tools/genenotebook/macros.xml | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/genenotebook/launch_gnb.sh b/tools/genenotebook/launch_gnb.sh index 4c99046..f9d5680 100755 --- a/tools/genenotebook/launch_gnb.sh +++ b/tools/genenotebook/launch_gnb.sh @@ -26,8 +26,6 @@ while ! grep -q "Listening on" ./mongod.log; do sleep 3 done; -echo "Mongod is ready, starting gnb now on port ${GNB_PORT} and with mongodb://${MONGO_URI}%2Fmongodb-27017.sock/genenotebook" - TMP_STORAGE=$(pwd)/tmp_storage mkdir "$TMP_STORAGE" @@ -36,6 +34,10 @@ touch gnb.log export NODE_OPTIONS="--max-old-space-size=$((${GALAXY_MEMORY_MB:-8192} * 75 / 100))" +# Find free port at the last moment +export GNB_PORT=$(bash "$(dirname "${BASH_SOURCE[0]}")/find_free_port.sh") +echo "Mongod is ready, starting gnb now on port ${GNB_PORT} and with mongodb://${MONGO_URI}%2Fmongodb-27017.sock/genenotebook" + genoboo run --storage-path "$TMP_STORAGE" --port ${GNB_PORT} --mongo-url mongodb://$MONGO_URI%2Fmongodb-27017.sock/genenotebook > ./gnb.log 2>&1 & export GNB_PID=$! diff --git a/tools/genenotebook/macros.xml b/tools/genenotebook/macros.xml index 2240d8e..268e327 100644 --- a/tools/genenotebook/macros.xml +++ b/tools/genenotebook/macros.xml @@ -37,7 +37,6 @@ For some unknwon reason, unixSocketPrefix needs an absolute path -->