Subject: Re: Setting a default ulimit for the whole system?
To: Gilles Gravier <Gilles@Gravier.org>
From: Carl Brewer <carl@bl.echidna.id.au>
List: netbsd-users
Date: 05/11/2007 11:30:45
Jeremy C. Reed wrote:
> On Thu, 10 May 2007, Gilles Gravier wrote:
> 
>> So no other way than rebuilding a kernel?
> 
> For logins (or other programs using login classes), put in /etc/login.conf 
> for default, like:
> 
> default:datasize=256m:
> 
> (Put the size you want. See login.conf.)
> 
> Then also use sysctl proc.curproc.rlimit.datasize.soft to set it (in 
> bytes) for the processes that start processes. Set "curproc" above to the 
> process ID you want.
> 
>> How about some settings file in /etc? That's indeed a bit harsh. :)
>>
>> Yes... I am trying to get a bigger data segment for php which complains about
>> not being able to allocate enough memory (though there is plenty available).
> 
> Probably just setting proc.curproc.rlimit.datasize.soft for the apache 
> startup script should be good enough. Maybe put it in 
> /etc/rc.conf.d/apache?

This is what I did to make my zope process work when Data.fs got too
big for the rather antiquanted limits builtin to NetBSD by default :

my zopectl file :

more zopectl
#! /bin/sh


#ulimit -d 131072
ulimit -d 393216
PYTHON="/usr/pkg/bin/python2.4"
ZOPE_HOME="/home/zope/zope-2.9.6"
INSTANCE_HOME="/home/zope/server"
CONFIG_FILE="/home/zope/server/etc/zope.conf"
SOFTWARE_HOME="/home/zope/zope-2.9.6/lib/python"
PYTHONPATH="$SOFTWARE_HOME"
etc ....

That worked for me, putting the ulimit in a startup script seemed the
easiest way at the time.

Carl