Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Persistent ulimit for daemons
Date: Wed, 01 Aug 2012 15:29:34
Message-Id: CADPrc80OPbjQcXH=LjQUCcp6HXFq=Ekmk4+P1Z_QM_010A3Sfg@mail.gmail.com
In Reply to: [gentoo-user] Persistent ulimit for daemons by Michael Orlitzky
1 On Wed, Aug 1, 2012 at 9:41 AM, Michael Orlitzky <michael@××××××××.com> wrote:
2 > Is there a blessed method these days for setting the ulimit per-daemon?
3 >
4 > The best I've been able to do is a global setting in /etc/rc.conf:
5 >
6 > rc_ulimit="-s 1048576"
7 >
8 > The entries under /etc/security seem to be ignored when using
9 > `/etc/init.d/foo start`.
10
11 If you are willing to try, systemd allows you to set not only the
12 limits for opened files, but also for basically every knob the Linux
13 kernel has. And to set it per daemon (or unit, in systemd parlance),
14 of course; for what you want, you would only need to set:
15
16 LimitNOFILE=<limit>
17
18 in the [Service] section of your unit. If you are interested, all the
19 relevant documentation is in systemd.exec(5).
20
21 Regards.
22 --
23 Canek Peláez Valdés
24 Posgrado en Ciencia e Ingeniería de la Computación
25 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] Persistent ulimit for daemons Michael Orlitzky <michael@××××××××.com>