Hari Sekhon created AMBARI-9391:
-----------------------------------

             Summary: Sudo only when not already root
                 Key: AMBARI-9391
                 URL: https://issues.apache.org/jira/browse/AMBARI-9391
             Project: Ambari
          Issue Type: Improvement
          Components: ambari-agent, ambari-server
    Affects Versions: 1.7.0
         Environment: HDP 2.2
            Reporter: Hari Sekhon


When deploying Ambari Agent via Ambari server, avoid use of sudo when already 
root as in some environments like mine where root is blocked from making sudo 
calls (due to servers being controlled centrally outside my department via 
Centrify), it results in failures to deploy agents (which must then be deployed 
manually via my own scripting).

It's possible to do something equivalent to this shell paradigm below that I've 
used for many years to detect if I'm root/uid 0 and if so just don't prefix 
commands with sudo.
{code}[ "$(id -u)" eq "0" ] && sudo="" || sudo=sudo
$sudo command1...
$sudo command2...
{code}

Regards,

Hari Sekhon
http://www.linkedin.com/in/harisekhon



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to