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/03/03 14:08:48 UTC

[1/2] ambari git commit: AMBARI-9891. Ambari-agent stop on Ubuntu fails (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.0 ce5f1c823 -> 6d2f7c855
  refs/heads/trunk 48eb11e78 -> b432db1c7


AMBARI-9891. Ambari-agent stop on Ubuntu fails (aonishuk)


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

Branch: refs/heads/trunk
Commit: b432db1c783388a191f290c55b8170c009f7dbf6
Parents: 48eb11e
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Mar 3 15:08:43 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Mar 3 15:08:43 2015 +0200

----------------------------------------------------------------------
 ambari-common/src/main/python/ambari_commons/shell.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b432db1c/ambari-common/src/main/python/ambari_commons/shell.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index 70f4af9..42b60f9 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -161,8 +161,9 @@ class shellRunnerLinux:
     if isinstance(script, list):
       cmd = " ".join(script)
 
-    p = subprocess.Popen(cmd, preexec_fn=_changeUid, stdout=subprocess.PIPE,
-                         stderr=subprocess.PIPE, shell=True, close_fds=True)
+    cmd_list = ["/bin/bash","--login","--noprofile","-c", cmd]
+    p = subprocess.Popen(cmd_list, preexec_fn=_changeUid, stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE, shell=False, close_fds=True)
     out, err = p.communicate()
     code = p.wait()
     logger.debug("Exitcode for %s is %d" % (cmd, code))


[2/2] ambari git commit: AMBARI-9891. Ambari-agent stop on Ubuntu fails (aonishuk)

Posted by ao...@apache.org.
AMBARI-9891. Ambari-agent stop on Ubuntu fails (aonishuk)


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

Branch: refs/heads/branch-2.0.0
Commit: 6d2f7c855e8715e49fbec0e1cfd7d125f4bc729d
Parents: ce5f1c8
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Mar 3 15:08:45 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Mar 3 15:08:45 2015 +0200

----------------------------------------------------------------------
 ambari-common/src/main/python/ambari_commons/shell.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d2f7c85/ambari-common/src/main/python/ambari_commons/shell.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index 70f4af9..42b60f9 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -161,8 +161,9 @@ class shellRunnerLinux:
     if isinstance(script, list):
       cmd = " ".join(script)
 
-    p = subprocess.Popen(cmd, preexec_fn=_changeUid, stdout=subprocess.PIPE,
-                         stderr=subprocess.PIPE, shell=True, close_fds=True)
+    cmd_list = ["/bin/bash","--login","--noprofile","-c", cmd]
+    p = subprocess.Popen(cmd_list, preexec_fn=_changeUid, stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE, shell=False, close_fds=True)
     out, err = p.communicate()
     code = p.wait()
     logger.debug("Exitcode for %s is %d" % (cmd, code))