Subject: Re: per process file descriptor limit
To: Milos Negovanovic <milos.negovanovic@googlemail.com>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-users
Date: 02/05/2007 15:25:31
Milos Negovanovic wrote:
> On Sun, Feb 04, 2007 at 05:06:23PM +0100, Christian Biere wrote:
> > I'm not sure but I think this a system-dependent default value. The
> > right place to edit defaults for these resource limits would be
> > /etc/login.conf, see login.conf(5). As a non-root user you cannot
> > increase these limits beyond their hard limit, so trying to do this
> > from the shell or the shell configuration file won't help. You can
> > only lower them.
> > 
> 
> Can you by any chance paste a snippet from working /etc/login.conf?

default|Default Class:\
	:datasize=204800000:\
	:coredumpsize-max=unlimited:\
	:coredumpsize-cur=0:\
	:openfiles=1024:\
	:umask=077:\
	:hushlogin:
root|Uber Class:\
	:coredumpsize-cur=0:\
	:openfiles=128:\
	:umask=077:\
	:hushlogin:\
	:term=vt220:\
	:ignorenologin:

Note that the "default" class in the above example would apply to all users
unless you put them into any other login class.

> How do you update the DB with cap_mkdb(1)?

cd /etc && cap_mkdb login.conf

Note, there's probably still a bug, so you might have to do this instead:

cd /etc && mv -i login.conf.db login.conf.db.bak && cap_mkdb login.conf

> How do you add new users? (Using useradd(8) with -L switch i presume, just it
> doesn't work here).

Do you mean adding existing users to a certain login class?

$ usermod -L <class> <user>

If you really mean adding a new user, it works equivalently:

$ useradd -L <class> ... <user>

Unlike many other operating systems, NetBSD has also userinfo which is
the most comfortable way to check these settings:

$ userinfo <user>

-- 
Christian