Before shutting down HDFS, execute dfsadmin -saveNamespace
Under script modes run in background & kill script after appropriate time elapse
Increase YARN_STOP_TIMEOUT to 60 seconds
Move HADOOP_STOP_TIMEOUT and YARN_STOP_TIMEOUT to hadoop-env.sh & yarn-env.sh

Increase YARN_STOP_TIMEOUT to 90 seconds.
Fix logic bug when only Zookeper is setup w/o Hadoop