You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/09/13 23:42:18 UTC

mesos git commit: Revert "Entered working directory before switch user."

Repository: mesos
Updated Branches:
  refs/heads/master c09214e52 -> aeaec8940


Revert "Entered working directory before switch user."

This reverts commit d25cafa30af94323fbd17dd220d7fdf7563e2f2a.


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

Branch: refs/heads/master
Commit: aeaec8940c7dd8e17e379fc7aa03fbce60d77b20
Parents: c09214e
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Sep 13 16:41:29 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Sep 13 16:41:29 2016 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/launch.cpp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/aeaec894/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index 0feaed1..b8ad27e 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -377,16 +377,6 @@ int MesosContainerizerLaunch::execute()
     }
   }
 
-  if (flags.working_directory.isSome()) {
-    Try<Nothing> chdir = os::chdir(flags.working_directory.get());
-    if (chdir.isError()) {
-      cerr << "Failed to chdir into current working directory "
-           << "'" << flags.working_directory.get() << "': "
-           << chdir.error() << endl;
-      return EXIT_FAILURE;
-    }
-  }
-
   // Change user if provided. Note that we do that after executing the
   // preparation commands so that those commands will be run with the
   // same privilege as the mesos-agent.
@@ -461,6 +451,16 @@ int MesosContainerizerLaunch::execute()
   }
 #endif // __linux__
 
+  if (flags.working_directory.isSome()) {
+    Try<Nothing> chdir = os::chdir(flags.working_directory.get());
+    if (chdir.isError()) {
+      cerr << "Failed to chdir into current working directory "
+           << "'" << flags.working_directory.get() << "': "
+           << chdir.error() << endl;
+      return EXIT_FAILURE;
+    }
+  }
+
   // Relay the environment variables.
   // TODO(jieyu): Consider using a clean environment.