ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-9891. Ambari-agent stop on Ubuntu fails (aonishuk)
Date Tue, 03 Mar 2015 13:08:49 GMT
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 <aonishuk@hortonworks.com>
Authored: Tue Mar 3 15:08:45 2015 +0200
Committer: Andrew Onishuk <aonishuk@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))


Mime
View raw message