ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hari Sekhon (JIRA)" <>
Subject [jira] [Created] (AMBARI-9391) Sudo only when not already root
Date Thu, 29 Jan 2015 11:06:34 GMT
Hari Sekhon created AMBARI-9391:

             Summary: Sudo only when not already root
                 Key: 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...


Hari Sekhon

This message was sent by Atlassian JIRA

View raw message