Uploaded image for project: 'CDH (READ-ONLY)'
  1. CDH (READ-ONLY)
  2. DISTRO-365

Hiveserver service script provides bad exit code

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: CDH3u2
    • Fix Version/s: CDH3u4
    • Component/s: Hive, Packaging
    • Labels:
    • Environment:
      Ubuntu

      Description

      Configuration management tools like Puppet and Chef depend on exit codes. In case of the hadoop-hive-server package, the /etc/init.d/hadoop-hive-server status call provides zero exit code independent of the service running or not. This makes Chef believe that the service is running and there is no need to start it. The fix should be very easy, only changing the three occurances of the $status variable in the service's hive_status() function to $RETVAL.

      Changed hive_status() function
      hive_status() {
          echo -n "Checking for service $desc: "
          pidofproc -p $PID_FILE java > /dev/null
          RETVAL=$?
      
          case "$RETVAL" in
            $STATUS_RUNNING)
              log_success_msg "@HADOOP_DAEMON@ is running"
              ;;
            $STATUS_DEAD)
              log_failure_msg "@HADOOP_DAEMON@ is dead and pid file exists"
              ;;
            $STATUS_DEAD_AND_LOCK)
              log_failure_msg "@HADOOP_DAEMON@ is dead and lock file exists"
              ;;
            $STATUS_NOT_RUNNING|$STATUS_DEBIAN_NOT_RUNNING)
              log_failure_msg "@HADOOP_DAEMON@ is not running"
              ;;
            *)
              log_failure_msg "@HADOOP_DAEMON@ status is unknown"
              ;;
          esac
          return $RETVAL
      }
      

        Attachments

          Activity

            People

            • Assignee:
              plinnell Peter Linnell
              Reporter:
              preko Zoltan Prekopcsak
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: