AMBARI-10165 Permission denied on .hash file when starting ambari server as non root user on ubuntu (dsen)
diff --git a/ambari-agent/src/main/python/ambari_agent/FileCache.py b/ambari-agent/src/main/python/ambari_agent/FileCache.py
index 3946b46..be5c23c 100644
--- a/ambari-agent/src/main/python/ambari_agent/FileCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/FileCache.py
@@ -206,6 +206,7 @@
     try:
       with open(hash_file, "w") as fh:
         fh.write(new_hash)
+      os.chmod(hash_file, 0o666)
     except Exception, err:
       raise CachingException("Can not write to file {0} : {1}".format(hash_file,
                                                                  str(err)))
diff --git a/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py b/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py
index 2d3996e..ffb6514 100644
--- a/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py
+++ b/ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py
@@ -219,6 +219,7 @@
     try:
       with open(hash_file, "w") as fh:
         fh.write(new_hash)
+      os.chmod(hash_file, 0o666)
     except Exception, err:
       raise KeeperException("Can not write to file {0} : {1}".format(hash_file,
                                                                    str(err)))