Subject: Re: A graceful way for ulimits?
To: Jeremy C. Reed <>
From: Peter Eisch <>
List: pkgsrc-users
Date: 03/20/2007 11:12:57
On 3/20/07 10:30 AM, "Jeremy C. Reed" <> wrote:

> On Tue, 20 Mar 2007, Peter Eisch wrote:
>> Is there a graceful way to fiddle with 'curproc' values by setting values in
>> rc.conf?  I need to up the descriptors limit for a package's apps.  I don't
>> want to simply edit the rc.d script, though that would be effective.
>> I could do it in rc.local, but I'd like to use a tighter tying to the
>> rc.conf if possible in the event the app is restarted after system start
>> time.
>> Ideas?
>> Specifics:  I need bacula-dir and bacula-sd's descriptors.soft increased to
>> something larger than 64.
>> Thanks,
> See the email from Simon B. on NetBSD-users on Feb 22 with subject:
> "managing process memory limits on the fly?"
> It suggests using an /etc/rc.conf.d/ file to run the ulimit command. Maybe
> have both /etc/rc.conf.d/bacula-dir and /etc/rc.conf.d/bacula-sd and the
> just have your ulimit command.

This is good.  It is curious about how this handy interface is documented in
rc.conf but is so hard to find.  Having an example in the man page, as given
in Simon's email (paraphrased):

> Create "/etc/rc.conf.d/service" that just contains
> # let service use 356MB
> ulimit -d 393216
> and that would changes limits for just things started by
> /etc/rc.d/service.
would be quite nifty.

This solution works well for me and has the added bonus that it isn't
monolithic like rc.local and is still covered by /etc/security's backups.

Thank you!