Support MAGPIE_ENVIRONMENT_VARIABLE_SCRIPT option
Fix logic bug in namenode safe mode wait time