[ 
https://issues.apache.org/jira/browse/MESOS-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15435077#comment-15435077
 ] 

Alexander Rukletsov commented on MESOS-5070:
--------------------------------------------

[~jieyu], [~js84], what are use cases for this change? We needed something 
similar with [~haosd...@gmail.com] recently and came up with the custom clone 
solution. It looks something like
{code}
// Call `setns` between `clone` and `exec`.
pid_t myClone(
    const lambda::function<int()>& func,
    pid_t taskPid,
    const vector<string>& namespaces)
{
  pid_t pid = os::clone([=]() -> int {
    foreach (const string& ns, namespaces) {
      Try<Nothing> setns = ns::setns(taskPid, namespace);
    }

    return func();
  }, SIGCHLD);

  return pid;
}
{code}

> Introduce more flexible subprocess interface for child options.
> ---------------------------------------------------------------
>
>                 Key: MESOS-5070
>                 URL: https://issues.apache.org/jira/browse/MESOS-5070
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Joerg Schad
>            Assignee: Joerg Schad
>              Labels: tech-debt
>
> We introduced a number of parameters to the subprocess interface with 
> MESOS-5049.
> Adding all options explicitly to the subprocess interface makes it 
> inflexible. 
> We should investigate a flexible options, which still prevents arbitrary code 
> to be executed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to