Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1210#discussion_r181799954
  
    --- Diff: distribution/src/resources/runbit ---
    @@ -65,6 +65,47 @@ drill_rotate_log ()
         fi
     }
     
    +args=( $@ )
    +RBARGS=()
    +for (( i=0; i < ${#args[@]}; i++ )); do
    +  case "${args[i]}" in
    +  --debug*)
    +      DEBUG=true
    +      DEBUG_STRING=`expr "${args[i]}" : '.*:\(.*\)'`
    +      ;;
    +   *) RBARGS+=("${args[i]}");;
    +  esac
    +done
    +
    +# Enables remote debug if requested
    +# Usage: --debug:[parameter1=value,parameter2=value]
    +# Optional parameters:
    +# port=[port_number] - debug port number
    +# suspend=[y/n] - pause until the IDE connects
    +
    +if [ $DEBUG ]; then
    +  debug_params=( $(echo $DEBUG_STRING | grep -o '[^,"]*') )
    +  for param in ${debug_params[@]}; do
    +    case $param in
    +    port*)
    +      DEBUG_PORT=`expr "$param" : '.*=\(.*\)'`
    +      ;;
    +    suspend*)
    +      DEBUG_SUSPEND=`expr "$param" : '.*=\(.*\)'`
    +      ;;
    +    esac
    +  done
    +
    +  if [ -z $DEBUG_PORT ]; then
    +    DEBUG_PORT=50000
    +  fi
    +  if [ -z $DEBUG_SUSPEND ]; then
    +    DEBUG_SUSPEND='n'
    +  fi
    +
    +  JAVA_DEBUG="-Xdebug -Xnoagent 
-Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=$DEBUG_SUSPEND"
    +fi
    --- End diff --
    
    This is overly complex and puts Drill in the business of tracking the 
arguments that the JVM wants to enable debugging. Those flags changed in the 
past and may change again.
    
    Would recommend instead:
    
    ```
    --jvm -anyArgumentYouWant
    ```
    
    Multiple `--jvm` arguments can appear. Simply append this to the the 
`DRILL_JAVA_OPTS` variable. Very simple.


---

Reply via email to