On Mon, Mar 16, 2015 at 07:23:59PM +0300, Vasiliy Tolstov wrote:
> I don't want setrlimit because it sets values to global space.

Hi Vasiliy,
    Are you sure about that?  I'm pretty sure setrlimit(RLIMIT_NOFILE, ...)
applies to the calling process, just like prlimit(0, RLIMIT_NOFILE, ...) would.

> 2015-03-16 19:30 GMT+03:00 Vasiliy Tolstov <[email protected]>:
> > Signed-off-by: Vasiliy Tolstov <[email protected]>
> > ---
> >  sheep/sheep.c | 63 
> > +++++++++++++++++++++++++++++++++++++++--------------------
> >  1 file changed, 42 insertions(+), 21 deletions(-)
> >
> > diff --git a/sheep/sheep.c b/sheep/sheep.c
> > index a1028a2..13cc927 100644
> > --- a/sheep/sheep.c
> > +++ b/sheep/sheep.c
> > @@ -561,26 +561,47 @@ static int create_work_queues(void)
> >
[cut]
> > +    len = asprintf(&buf, "%lu", new.rlim_max);
> > +    if (len > 0) {
> > +      fd = open("/proc/sys/fs/nr_open", O_WRONLY);

The distribution and system administrator already have control over this by 
sysctl.
I don't think sheepdog should be modifying the kernel's limits.  It's too much 
magic.

Thanks.


Alexander

-- 
sheepdog mailing list
[email protected]
https://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to