Repository: mesos
Updated Branches:
  refs/heads/master 844673405 -> 3ae937fb1


Used execlp instead of execl to exec processes in Mesos.

Review: https://reviews.apache.org/r/37547


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/bd4332c6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bd4332c6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bd4332c6

Branch: refs/heads/master
Commit: bd4332c68aea3aaf8eac3ef3a15b72541084e0c4
Parents: d7d3b52
Author: Jie Yu <[email protected]>
Authored: Mon Aug 17 12:47:52 2015 -0700
Committer: Jie Yu <[email protected]>
Committed: Mon Aug 17 14:27:30 2015 -0700

----------------------------------------------------------------------
 src/launcher/executor.cpp                  |  4 ++--
 src/slave/containerizer/mesos/launch.cpp   |  2 +-
 src/tests/containerizer/isolator_tests.cpp | 18 +++++++++---------
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bd4332c6/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index 9fa7dcf..50b3c6e 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -236,8 +236,8 @@ public:
       // The child has successfully setsid, now run the command.
       if (override.isNone()) {
         if (task.command().shell()) {
-          execl(
-              "/bin/sh",
+          execlp(
+              "sh",
               "sh",
               "-c",
               task.command().value().c_str(),

http://git-wip-us.apache.org/repos/asf/mesos/blob/bd4332c6/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp 
b/src/slave/containerizer/mesos/launch.cpp
index 96ca47d..bd594d3 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -263,7 +263,7 @@ int MesosContainerizerLaunch::execute()
 
   if (command.get().shell()) {
     // Execute the command using shell.
-    execl("/bin/sh", "sh", "-c", command.get().value().c_str(), (char*) NULL);
+    execlp("sh", "sh", "-c", command.get().value().c_str(), (char*) NULL);
   } else {
     // Use os::execvpe to launch the command.
     char** argv = new char*[command.get().arguments().size() + 1];

http://git-wip-us.apache.org/repos/asf/mesos/blob/bd4332c6/src/tests/containerizer/isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/isolator_tests.cpp 
b/src/tests/containerizer/isolator_tests.cpp
index fdb7064..2755d06 100644
--- a/src/tests/containerizer/isolator_tests.cpp
+++ b/src/tests/containerizer/isolator_tests.cpp
@@ -191,7 +191,7 @@ TYPED_TEST(CpuIsolatorTest, UserCpuUsage)
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       argv,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),
@@ -301,7 +301,7 @@ TYPED_TEST(CpuIsolatorTest, SystemCpuUsage)
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       argv,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),
@@ -493,7 +493,7 @@ TEST_F(LimitedCpuIsolatorTest, ROOT_CGROUPS_Cfs)
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       argv,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),
@@ -595,7 +595,7 @@ TEST_F(LimitedCpuIsolatorTest, ROOT_CGROUPS_Cfs_Big_Quota)
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       argv,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),
@@ -685,7 +685,7 @@ TEST_F(LimitedCpuIsolatorTest, ROOT_CGROUPS_Pids_and_Tids)
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       argv,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),
@@ -961,14 +961,14 @@ TEST_F(SharedFilesystemIsolatorTest, 
DISABLED_ROOT_RelativeVolume)
   // Manually run the isolator's preparation command first, then touch
   // the file.
   vector<string> args;
-  args.push_back("/bin/sh");
+  args.push_back("sh");
   args.push_back("-x");
   args.push_back("-c");
   args.push_back(prepare.get().get().commands(0).value() + " && touch " + 
file);
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       args,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),
@@ -1064,7 +1064,7 @@ TEST_F(SharedFilesystemIsolatorTest, 
DISABLED_ROOT_AbsoluteVolume)
   ASSERT_FALSE(os::exists(path::join(containerPath, filename)));
 
   vector<string> args;
-  args.push_back("/bin/sh");
+  args.push_back("sh");
   args.push_back("-x");
   args.push_back("-c");
   args.push_back(prepare.get().get().commands(0).value() +
@@ -1073,7 +1073,7 @@ TEST_F(SharedFilesystemIsolatorTest, 
DISABLED_ROOT_AbsoluteVolume)
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "/bin/sh",
+      "sh",
       args,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),

Reply via email to