Merge -c 1390218 from trunk to branch-2 to fix HADOOP-8794. Rename YARN_HOME to HADOOP_YARN_HOME. Contributed by Vinod K V.