]> source.dussan.org Git - sonarqube.git/commitdiff
add -d option to start.sh to remote debug web server
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 14 Apr 2015 07:43:47 +0000 (09:43 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 15 Apr 2015 13:03:45 +0000 (15:03 +0200)
start.sh

index 9c3a25a20cc34895b695e19cf77fe572f0ef3f9f..2c29ef02cbd3a6f0464384fa071ac914db1027a3 100755 (executable)
--- a/start.sh
+++ b/start.sh
@@ -1,9 +1,14 @@
 #!/bin/bash
+###############################
+# usage: use -d option to enable remote debugging of the web server on port 5005
+###############################
 
 if [[ "$OSTYPE" == "darwin"* ]]; then
   OS='macosx-universal-64'
+  SED_DISABLE_BACKUP=" ''"
 else
   OS='linux-x86-64'
+  SED_DISABLE_BACKUP=""
 fi
 
 ls sonar-application/target/sonarqube-*.zip 1> /dev/null 2>&1
@@ -18,6 +23,14 @@ if [ "$?" != "0" ]; then
   unzip sonarqube-*.zip
 fi
 cd sonarqube-*
+
+if [ "$1" = "-d" ]; then
+  echo "enabling debug in conf/sonar.properties, listening on port 5005"
+  sed -i $SED_DISABLE_BACKUP '/javaAdditionalOpts/d' conf/sonar.properties
+  echo "" >> conf/sonar.properties
+  echo "sonar.web.javaAdditionalOpts=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" >> conf/sonar.properties
+fi
+
 bin/$OS/sonar.sh restart
 sleep 1
 tail -100f logs/sonar.log