> On April 1, 2015, 12:55 a.m., Ben Mahler wrote: > > src/slave/containerizer/isolators/posix/disk.cpp, lines 416-419 > > <https://reviews.apache.org/r/32694/diff/2/?file=911373#file911373line416> > > > > Can't you just bind directly into `prctl`? > > > > E.g. > > > > ``` > > Option<lambda::function<int()>> setup = None(); > > > > #ifdef __linux__ > > setup = lambda::bind(::prctl(PR_SET_PDEATHSIG, SIGKILL)); > > #endif > > > > Try<Subprocess> s = subprocess( > > "du", > > argv, > > Subprocess::PATH("/dev/null"), > > Subprocess::PIPE(), > > Subprocess::PIPE(), > > None(), > > None(), > > setup); > > ```
This has slightly different semantics because if prctl fails, the subprocess won't be exec'ed. I want to make it a best effort semantics. I liked the idea of using lambda here. I tried to use an anonymous struct functor here. But it does not work on gcc-4.4. - Jie ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32694/#review78457 ----------------------------------------------------------- On March 31, 2015, 7:32 p.m., Jie Yu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32694/ > ----------------------------------------------------------- > > (Updated March 31, 2015, 7:32 p.m.) > > > Review request for mesos, Ben Mahler, Ian Downes, and Vinod Kone. > > > Bugs: MESOS-2462 > https://issues.apache.org/jira/browse/MESOS-2462 > > > Repository: mesos > > > Description > ------- > > Set death signal for forked du processes for posix/disk isolator. > > > Diffs > ----- > > src/slave/containerizer/isolators/posix/disk.cpp > 6e41e2a72cdcf914f2c922fdcb3d267b938e456e > > Diff: https://reviews.apache.org/r/32694/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jie Yu > >
