adoroszlai commented on a change in pull request #15: AMBARI-24851 - Logsearch: 
debug mode using java 8 and 11
URL: https://github.com/apache/ambari-logsearch/pull/15#discussion_r229597012
 
 

 ##########
 File path: ambari-logsearch-server/src/main/scripts/logsearch.sh
 ##########
 @@ -149,7 +149,11 @@ function start() {
   LOGSEARCH_DEBUG_PORT=${LOGSEARCH_DEBUG_PORT:-"5005"}
 
   if [ "$LOGSEARCH_DEBUG" = "true" ]; then
-    LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=*:$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
 "
+    if [ $java_version == "8" ]; then
+      LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
 "
+    else
+      LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=*:$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
 "
 
 Review comment:
   Sorry for nitpicking, but please consider a more DRY version, like this:
   
   ```
         if [ $java_version == "8" ]; then
           LOGSEARCH_DEBUG_ADDRESS=$LOGSEARCH_DEBUG_PORT
         else
           LOGSEARCH_DEBUG_ADDRESS="*:$LOGSEARCH_DEBUG_PORT"
         fi
         LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_ADDRESS,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
 "
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to