AMBARI-17447. Datanode start fails with umask 027 on ambari-server node 
(aonishuk)


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

Branch: refs/heads/branch-2.4
Commit: 96de8ef011deee817301357d92af16047ba184b5
Parents: 9d9bbe7
Author: Andrew Onishuk <[email protected]>
Authored: Mon Jun 27 15:45:21 2016 +0300
Committer: Andrew Onishuk <[email protected]>
Committed: Mon Jun 27 15:45:21 2016 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_server/serverSetup.py      | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/96de8ef0/ambari-server/src/main/python/ambari_server/serverSetup.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py 
b/ambari-server/src/main/python/ambari_server/serverSetup.py
index dad3083..d80c25a 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -786,9 +786,14 @@ class JDKSetupLinux(JDKSetup):
 
   def adjust_jce_permissions(self, jdk_path):
     ambari_user = read_ambari_user()
-    cmd = self.SET_JCE_PERMISSIONS.format(ambari_user, jdk_path, 
configDefaults.JDK_SECURITY_DIR)
-    cmd += " && " + self.SET_JCE_FILE_MODE.format(jdk_path, 
configDefaults.JDK_SECURITY_DIR, "*")
-    cmd += " && " + self.SET_JCE_JAR_MODE.format(jdk_path, 
configDefaults.JDK_SECURITY_DIR, "*.jar")
+    cmds = []
+    if ambari_user:
+      cmds.append(self.SET_JCE_PERMISSIONS.format(ambari_user, jdk_path, 
configDefaults.JDK_SECURITY_DIR))
+    cmds.append(self.SET_JCE_FILE_MODE.format(jdk_path, 
configDefaults.JDK_SECURITY_DIR, "*"))
+    cmds.append(self.SET_JCE_JAR_MODE.format(jdk_path, 
configDefaults.JDK_SECURITY_DIR, "*.jar"))
+
+    cmd = " && ".join(cmds)
+
     process = subprocess.Popen(cmd,
                            stdout=subprocess.PIPE,
                            stdin=subprocess.PIPE,
@@ -797,6 +802,9 @@ class JDKSetupLinux(JDKSetup):
                            )
     (stdoutdata, stderrdata) = process.communicate()
 
+    if process.returncode != 0:
+      print_warning_msg("Failed to change jce permissions. 
{0}\n{1}".format(stderrdata, stdoutdata))
+
 def download_and_install_jdk(options):
   properties = get_ambari_properties()
   if properties == -1:

Reply via email to