Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-8222

bin/hadoop should allow callers to set jsvc pidfile even when not-detached

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 0.20.205.0, 0.23.1
    • None
    • scripts
    • None

    Description

      it would be nice if the jsvc pid file were properly namespaced in /var/run to avoid collisions with other jsvc instances

      jsvc uses /var/run/jsvc.pid for the datanode pid file. If that's configurable, it should be configured: /var/run/jsvc.pid is sorely not namespaced.

      if [ "$_HADOOP_DAEMON_DETACHED" = "true" ]; then
      _JSVC_FLAGS="-pidfile $_HADOOP_DAEMON_PIDFILE
      -errfile &1
      -outfile $_HADOOP_DAEMON_OUT"
      else

      1. Even though we are trying to run a non-detached datanode,
      2. jsvc will not write to stdout/stderr, so we have to pipe
      3. it and tail the logfile.
        log_path=/tmp/jsvc_${COMMAND}.$$
        _JSVC_FLAGS="-nodetach
        -errfile &1
        -outfile $log_path"
        echo Non-detached jsvc output piping to: $log_path
        touch $log_path
        tail -f $log_path &
        fi

      And the relevant argument is '-pidfile' (http://linux.die.net/man/1/jsvc).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              plinnell Peter Linnell
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: