Browse Source

AMBARI-2502. Permissions issue on server start up causes server to fail immediately on startup. (swagle)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1497208 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Wagle 12 years ago
parent
commit
3a977e23d8
1 changed files with 5 additions and 1 deletions
  1. 5 1
      ambari-server/src/main/python/ambari-server.py

+ 5 - 1
ambari-server/src/main/python/ambari-server.py

@@ -389,7 +389,6 @@ NR_ADJUST_OWNERSHIP_LIST =[
   ( "/etc/ambari-server/conf", "644", "{0}", "{0}", True ),
   ( "/etc/ambari-server/conf", "755", "{0}", "{0}", False ),
   ( "/etc/ambari-server/conf/password.dat", "640", "{0}", "{0}", False ),
-
   # Also, /etc/ambari-server/conf/password.dat
   # is generated later at store_password_file
 ]
@@ -568,6 +567,11 @@ def adjust_directory_permissions(ambari_user):
   cmd = RECURSIVE_RM_CMD.format(bootstrap_dir)
   run_os_command(cmd)
   os.mkdir(bootstrap_dir)
+  # Add master key if exists
+  keyLocation = get_master_key_location(properties)
+  masterKeyFile = search_file(SECURITY_MASTER_KEY_FILENAME, keyLocation)
+  if masterKeyFile:
+    NR_ADJUST_OWNERSHIP_LIST.append((masterKeyFile, "600", "{0}", "{0}", False))
   print "Adjusting file permissions and ownership..."
   for pack in NR_ADJUST_OWNERSHIP_LIST:
     file = pack[0]