Hi, @Hansel Chung As I checked, if --swithc_user=true (default variable is
true) when you launch Mesos agent, executor would call os::setuid
and os::setgroups before launch your tasks. But the shell environment may
not set. (I remember we have a ticket for this.) You could use `id` as your
task command to verify if user set correctly.


On Fri, Jun 17, 2016 at 9:17 AM, Hansel Chung <[email protected]> wrote:

> Hi,
>
> I had a question, I noticed that if mesos frameworks request that
> executors use a certain user, the env variables aren't set up for that
> user, but what the agent daemon was run as.
>
> As an example:
> Run mesos-slave as root:
> HOME=/root
> USER=root
>
> If I have an executor to be launched as testuser, the env looks like:
> HOME=/root
> USER=root
> instead of:
> HOME=/home/testuser
> USER=testuser
>
> This is normally set by login or sudo when running as a user, but I can't
> seem to find a way to use these to set up a proper environment as the
> target user. Is there a reason we don't call getpwuid() to set a
> $HOME during setup of execlp() from executor.cpp? (Oh, and might as well
> populate $USER while we're at it)
>
> Thanks,
> -Hansel
>



-- 
Best Regards,
Haosdent Huang

Reply via email to