You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/09/08 10:36:49 UTC

[2/2] ambari git commit: AMBARI-13029. when ambari-agent has 'run_as_user' as a comment in ambari-agent.ini, wrong user to run ambari as can be picked up (aonishuk)

AMBARI-13029. when ambari-agent has 'run_as_user' as a comment in ambari-agent.ini, wrong user to run ambari as can be picked up (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0cbe4da8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0cbe4da8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0cbe4da8

Branch: refs/heads/branch-2.1
Commit: 0cbe4da800555d440933cb6eabedd5628c222a0a
Parents: 6176199
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Sep 8 11:36:39 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Sep 8 11:36:39 2015 +0300

----------------------------------------------------------------------
 ambari-agent/etc/init.d/ambari-agent | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0cbe4da8/ambari-agent/etc/init.d/ambari-agent
----------------------------------------------------------------------
diff --git a/ambari-agent/etc/init.d/ambari-agent b/ambari-agent/etc/init.d/ambari-agent
index 01fc45c..b2c3109 100644
--- a/ambari-agent/etc/init.d/ambari-agent
+++ b/ambari-agent/etc/init.d/ambari-agent
@@ -19,7 +19,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-run_as_user=`cat /etc/ambari-agent/conf/ambari-agent.ini | grep run_as_user | tr -d ' ' | awk -F '=' '{ print $2}'`
+run_as_user=`cat /etc/ambari-agent/conf/ambari-agent.ini | grep run_as_user | tr -d ' ' | grep -v '^;\|^#' | awk -F '=' '{ print $2}'`
 
 if [ "$EUID" != `id -u $run_as_user` ] ; then
   command_prefx="su - $run_as_user -c"