From 6b2070bdc350a577f975ac2f39c2b121098fabcb Mon Sep 17 00:00:00 2001 From: Zipeng WU Date: Wed, 30 Aug 2023 14:49:07 +0200 Subject: [PATCH] SONAR-20310 Provide PIDDIR environment variable in the bootstrap script to allow customization --- .../src/main/assembly/bin/linux-x86-64/sonar.sh | 5 ++++- .../src/main/assembly/bin/macosx-universal-64/sonar.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh b/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh index 41085b8ccac..8f0408e1190 100755 --- a/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh +++ b/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh @@ -2,6 +2,9 @@ APP_NAME="SonarQube" +# Location of the pid file. +PIDDIR="${PIDDIR-.}" + # By default, java from the PATH is used, except if SONAR_JAVA_PATH env variable is set findjava() { if [ -z "${SONAR_JAVA_PATH}" ]; then @@ -86,7 +89,7 @@ XMX="-Xmx32m" COMMAND_LINE="$JAVA_CMD $XMS $XMX $HAZELCAST_ADDITIONAL -jar $LIB_DIR/sonar-application-@sqversion@.jar" # Location of the pid file. -PIDFILE="./$APP_NAME.pid" +PIDFILE="$PIDDIR/$APP_NAME.pid" # Resolve the location of the 'ps' command PSEXE="/usr/bin/ps" diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh b/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh index abb9b0ca653..41040a0aa20 100755 --- a/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh +++ b/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh @@ -2,6 +2,9 @@ APP_NAME="SonarQube" +# Location of the pid file. +PIDDIR="${PIDDIR-.}" + # By default, java from the PATH is used, except if SONAR_JAVA_PATH env variable is set findjava() { if [ -z "${SONAR_JAVA_PATH}" ]; then @@ -86,7 +89,7 @@ XMX="-Xmx32m" COMMAND_LINE="$JAVA_CMD $XMS $XMX $HAZELCAST_ADDITIONAL -jar $LIB_DIR/sonar-application-@sqversion@.jar" # Location of the pid file. -PIDFILE="./$APP_NAME.pid" +PIDFILE="$PIDDIR/$APP_NAME.pid" # Resolve the location of the 'ps' command PSEXE="/usr/bin/ps" -- 2.39.5