Uploaded image for project: 'Bigtop'
  1. Bigtop
  2. BIGTOP-2802

Some packages don't create necessary groups on debian-based system if the users correspond to them already exist

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.1
    • Component/s: None
    • Labels:
      None

      Description

      For example, user and group creation for yarn are independent on rpm-based systems:

      bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
      557 %pre yarn
      558 getent group yarn >/dev/null   || groupadd -r yarn
      559 getent passwd yarn >/dev/null || /usr/sbin/useradd --comment "Hadoop Yarn" --shell /bin/bash -M -r -g yarn -G hadoop --home %{state_yarn} yarn
      

      but on debian-based systems, yarn group creation is skipped if yarn user is created in advance:

      bigtop-packages/src/deb/hadoop/hadoop-yarn.preinst
       34     install|upgrade)
       35         if ! getent passwd yarn >/dev/null; then
       36             # Adding system user: yarn.
       37             adduser \
       38                 --system \
       39                 --group \
       40                 --home /var/lib/hadoop-yarn \
       41                 --gecos "Hadoop YARN" \
       42                 --shell /bin/bash \
       43                 yarn >/dev/null 2>/dev/null || :
       44             usermod --append --groups hadoop yarn || :
       45         fi
       46     ;;
      

      It causes a problem when the package is used with Ambari. When Ambari installs a stack, it creates users such as hdfs, yarn, mapred besides hadoop, but it creates only hadoop group.
      So installing hadoop-yarn skips the above path and fails with the following error:

      Setting up hadoop-yarn (2.7.3-1) ...
      chown: invalid group: 'root:yarn'
      dpkg: error processing package hadoop-yarn (--configure):
       subprocess installed post-installation script returned error exit status 1
      Errors were encountered while processing:
       hadoop-yarn
      

      at line 24 in the following code:

      bigtop-packages/src/deb/hadoop/hadoop-yarn.postinst
       23     configure)
       24         chown root:yarn /usr/lib/hadoop-yarn/bin/container-executor
       25         chmod 4754 /usr/lib/hadoop-yarn/bin/container-executor
       26         mkdir -p /var/log/hadoop-yarn /var/run/hadoop-yarn /var/lib/hadoop-yarn/cache || :
       27         chown yarn:hadoop /var/log/hadoop-yarn /var/run/hadoop-yarn
       28         chmod g+w /var/log/hadoop-yarn /var/run/hadoop-yarn
       29         chown yarn:hadoop /var/lib/hadoop-yarn/ /var/lib/hadoop-yarn/cache
       30         chmod 0755 /var/lib/hadoop-yarn
       31         chmod 1777 /var/lib/hadoop-yarn/cache
       32     ;;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sekikn Kengo Seki
                Reporter:
                sekikn Kengo Seki
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: