Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-9828

Ability to handle envs where sudo is not available

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None

    Description

      Attempted to start "ambari-agent start" as root but it fails with "You can't
      perform this operation as non-sudoer user. Please, re-login as one" message.
      Commented out this code and start worked...

      echo "" | sudo -S -l > /dev/null 2>&1
      if [ "$?" != "0" ]; then
      echo "You can't perform this operation as non-sudoer user. Please, re-login as one"
      exit 0
      fi

      current_user=`awk -v val=$EUID -F ":" '$3==val

      {print $1}

      ' /etc/passwd`

      change_files_permissions()

      { sudo chown -R $current_user "/var/run/ambari-agent" sudo chown -R $current_user "/var/log/ambari-agent" sudo chown -R $current_user "/var/lib/ambari-agent/data" sudo chown -R $current_user "/var/lib/ambari-agent/cache" sudo chown $current_user "/usr/lib/ambari-agent" }

      I think there is a broader issue here with sudo in certain envs.

      Attachments

        Issue Links

          Activity

            People

              aonishuk Andrew Onischuk
              aonishuk Andrew Onischuk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: