Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Dec 2012 17:47:37 -0500
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Vagner <vagner@bsdway.ru>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Login class and limit
Message-ID:  <444njy6bna.fsf@lowell-desk.lan>
In-Reply-To: <20121206203638.GA4540@vagner-wrk.bsdway.ru> (vagner@bsdway.ru's message of "Fri, 7 Dec 2012 00:36:38 %2B0400")
References:  <20121206143201.GB42583@vagner-wrk.bsdway.ru> <37A52274-D877-4AED-82F3-CF058DEC9DBE@mac.com> <20121206203638.GA4540@vagner-wrk.bsdway.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Vagner <vagner@bsdway.ru> writes:

> On 06:53 Thu 06 Dec , Charles Swiger wrote:

>> "su -", "su -l", and "sudo -i" provide a login shell, which gets the
>> limits setup by login.conf.  Normally daemons are started at boot
>> via rc mechanism (or perhaps get spawned from inetd) and do not
>> have a login shell associated with them to setup the limits.
>> 
>> Either use one of the su/sudo flavors I mention above, or "/bin/sh -l"
>> to provide a login env to the process?
>
> ie means to implement restrictions limits(1) and login.conf(5) for daemons is not possible?

It's possible, but you would have to use a login shell, which is usually
inconvenient for a daemon (not having an attached terminal for I/O).

The usual way to do this is to start the daemon in a script that
explicitly sets the limits with /usr/bin/limits (or maybe ulimit, but
limits(1) seems more common). Several ports do this, for example.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?444njy6bna.fsf>