Skip to content

Commit

Permalink
Revert "Entered working directory before switch user."
Browse files Browse the repository at this point in the history
This reverts commit d25cafa.
  • Loading branch information
jieyu committed Sep 13, 2016
1 parent c09214e commit aeaec89
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/slave/containerizer/mesos/launch.cpp
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down

5 comments on commit aeaec89

@kamilchm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this was reverted? I found it to be an issue on NixOS NixOS/nixpkgs#19064

@vinodkone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilchm can you file a ticket on issues.apache.org?

@kamilchm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll do to it tomorrow with more details.

@cstrahan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilchm Which error, specifically, is caused by this?

@kamilchm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've encountered permission denied problems when I ran Marathon with different user than root set in NixOS service config.

Please sign in to comment.