code: private void assignUserFileOwnership(final String effectiveUser, final String fileName) throws
        Exception {
      final ExecuteAsUser executeAsUser = new ExecuteAsUser(
          this.getSysProps().getString(AZKABAN_SERVER_NATIVE_LIB_FOLDER));
      final String groupName = this.getSysProps().getString(AZKABAN_SERVER_GROUP_NAME, "azkaban");
      final List<String> changeOwnershipCommand = Arrays
          .asList(CHOWN, effectiveUser + ":" + groupName, fileName);
      info("Change ownership of " + fileName + " to " + effectiveUser + ":" + groupName + ".");
      final int result = executeAsUser.execute("root", changeOwnershipCommand);
      if (result != 0) {
        handleError("Failed to change current working directory ownership. Error code: " + Integer
            .toString(result), null);
      }
    }
docs: Changes permissions on file/directory so that the file/directory is owned by the user and the
  group remains the azkaban service account name.
  
  Leverages execute-as-user with "root" as the user to run the command.
  
  @param effectiveUser user/proxy user running the job
  @param fileName the name of the file whose permissions will be changed