Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 365243

Summary: sys-apps/openrc feature request: Per-service ulimit
Product: Gentoo Linux Reporter: Patrick Lauer <patrick>
Component: New packagesAssignee: OpenRC Team <openrc>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Patrick Lauer gentoo-dev 2011-04-28 20:14:28 UTC
Similar to bug #361073 - 

I'd like a simple way to define service limits, for example postgres should not have any limits, but lighttpd shouldn't use more than 100MB.

A variable in /etc/conf.d/$servicename would be most convenient, that way I could set ULIMIT="-m 100000" and have that service limited to 100M per process.

System-wide limits are not that useful in this case, but as far as I remember the ulimit values are inherited to children, so anything started from the init script should inherit the given per-service limits.
Comment 1 SpanKY gentoo-dev 2011-04-28 20:22:43 UTC
doesnt pam already do this for you ?
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-05-01 05:26:27 UTC
This is already available.

rc_ulimit="-m 100000"

See the main rc.conf.
Comment 3 Patrick Lauer gentoo-dev 2011-05-02 19:08:06 UTC
(In reply to comment #2)
> This is already available.
> 
> rc_ulimit="-m 100000"
> 
> See the main rc.conf.

As far as I can tell that's a global limit - if not then the documentation on it should be extended and a per-service example given.
Comment 4 William Hubbs gentoo-dev 2011-05-05 16:04:04 UTC
The following is the section heading in rc.conf for the section where
rc_ulimit is documented:

##############################################################################
# SERVICE CONFIGURATION VARIABLES
# These variables are documented here, but should be configured in
# /etc/conf.d/foo for service foo and NOT enabled here unless you
# really want them to work on a global basis.

I do not see that there is anything for us to do for this bug.