Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c (date 1483652443000) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c (date 1483732039000) @@ -62,6 +62,13 @@ #include "compat/unlinkat.h" #endif +#ifdef __linux +// Avoid errors in case of noexec mount option +#define RUN_SHELL_SCRIPT "bash", +#else +#define RUN_SHELL_SCRIPT +#endif + static const int DEFAULT_MIN_USERID = 1000; static const char* DEFAULT_BANNED_USERS[] = {"yarn", "mapred", "hdfs", "bin", 0}; @@ -1608,7 +1615,7 @@ #endif umask(0027); - if (execlp(script_file_dest, script_file_dest, NULL) != 0) { + if (execlp(RUN_SHELL_SCRIPT script_file_dest, script_file_dest, NULL) != 0) { fprintf(LOGFILE, "Couldn't execute the container launch file %s - %s", script_file_dest, strerror(errno)); exit_code = UNABLE_TO_EXECUTE_CONTAINER_SCRIPT;