Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2549

There are two logic errors when installing the solr audit log module

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 2.1.0
    • None
    • Ranger
    • Patch

    Description

      The install.sh will print 'Command not found' when installing the solr audit log module, as follow:

      [root@wkh001 solr_for_audit_setup]# ./setup.sh
      ./setup.sh: line 29: log: Command not found
      

      Then I analyse the install.sh, there is one error code, as follow: 

      if  test -z "$validateProperty" ; then log "[E] '$1' not found in $2 file while getting....!!"; exit 1; fi
      

      Because the function log is undefined, and in other places, we use echo to print log, We need to be unified as 'echo'.

      When I modify this bug, then execute setup.sh, it shows another error, as follow:

      setup.sh: line 68:[: Too many parameters
      

      Then I find another logic bug, if you don't config JAVA_HOME in install.properties, CONFIG_JAVA_HOME will get an error message and influence subsequent processe.

      CONFIG_JAVA_HOME=$(get_prop 'JAVA_HOME' $PROPFILE)
      JAVA_HOME=${CONFIG_JAVA_HOME:-$JAVA_HOME}
      

      So I modified two places, and test in three scenes, first is that JAVA_HOME is nonexistent, second is that JAVA_HOME is not configured, like 'JAVA_HOME=', third is that JAVA_HOME is configured.

      Please check my patch, thanks.

      Attachments

        Activity

          People

            wkh8011 wu.kehua
            wkh8011 wu.kehua
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: