Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120151 - integrate ulimit support into all services
Summary: integrate ulimit support into all services
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All All
: High enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 01:55 UTC by Martin Klebermass
Modified: 2006-02-21 19:59 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Allows each service to specify RC_ULIMIT (ulimit.patch,4.04 KB, patch)
2006-01-25 06:11 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Klebermass 2006-01-24 01:55:34 UTC
im
running gentoo linux primary on server systems.
Sometimes single processes run crazy and eat up all memory. 
To prevent any bigger problems (as the kernel starts killing proccesses)
im starting my daemons with a ulimit limitation of memory etc.

It would be a nice feature to implement this ulimit limitation directly in the init runscript programm.

The second nice feature would be multiple programm instances.
Just like the net.eth0 and net.eth1 it would be nice to have things like mysql.config1 and mysql.config2 where mysql will not use the default config directory /etc/mysql but will use /etc/mysql.config1 ... .

I wanted to write this ideas down so that someone interested could probably implement them (or if i have time later on i will do it myself), and so that thez are not forgotten)
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-01-24 02:10:58 UTC
(In reply to comment #0)
> It would be a nice feature to implement this ulimit limitation directly in the
> init runscript programm.

What's wrong with /etc/security/limits.conf ?


> Just like the net.eth0 and net.eth1 it would be nice to have things like
> mysql.config1 and mysql.config2 where mysql will not use the default config
> directory /etc/mysql but will use /etc/mysql.config1 ... .

That's already implemented (in >=mysql-4.1 at least) - see /etc/conf.d/mysql and it's slots feature.

Have I missed something?
Comment 2 Martin Klebermass 2006-01-24 02:30:44 UTC
as i understood it
limits.conf  maps to the user globaly

and ulimit works on the running shell and all its subproccesses.

Eg the example of using mysql with 2 instances you can limit it with the limits.conf only for both together,  not for each one seperat.


Comment 3 Martin Klebermass 2006-01-24 02:37:39 UTC
i forgot another more important thing.
Eq apache is running its master process as root (and forks its clients as another user)
So apache has the limits of the root user not the apache user. using ulimit you can set limits for apache too.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-01-24 02:42:13 UTC
No idea how you'd like to solve this on baselayout level. If you are suggesting a solution on per-package basis, then a summary bug won't work...
Comment 5 Martin Klebermass 2006-01-24 02:46:04 UTC
Well nearly every package has a /etc/conf.d/file entry
shouldn it be posible to set there a parameter ULIMIT_MEMORY
which when set it will be used to activate a ulimit in the start routine??


Comment 6 SpanKY gentoo-dev 2006-01-24 05:27:28 UTC
this bug only covers the first request mentioned in the original comment

i dont think this should be too hard to implement ...
Comment 7 Roy Marples (RETIRED) gentoo-dev 2006-01-25 06:11:59 UTC
Created attachment 78073 [details, diff]
Allows each service to specify RC_ULIMIT

Here's a quick patch that enables RC_ULIMIT support on a global basis or a per-service basis for baselayout-1.12.0_pre15-r1.

It seems to work fine and I've applied it to our svn - will be in baselayout-1.12.0_pre16 unless anyone finds anything wrong with it and posts back here.
Comment 8 Roy Marples (RETIRED) gentoo-dev 2006-02-21 19:59:22 UTC
pre16 is out