public static void setUnixFilePermissions(String mode, String path) {
    if (LINUX) {
      try {
        runCommand(new String[]{"chmod", mode, path});
      } catch (IOException | InterruptedException e) {
        // Improbable
        LOG.warn(String.format("Can not perform chmod %s %s", mode, path), e);
      }
    } else {
      LOG.debug(String.format("Not performing chmod %s command for file %s " +
          "because current OS is not Linux ", mode, path));
    }
  }
Sets file permissions to a given value on Linux systems.
On Windows/Mac, command is silently ignored

@param mode
@param path
ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java