1 |
On 08/01/12 11:27, Canek Peláez Valdés wrote: |
2 |
> On Wed, Aug 1, 2012 at 9:41 AM, Michael Orlitzky <michael@××××××××.com> wrote: |
3 |
>> Is there a blessed method these days for setting the ulimit per-daemon? |
4 |
>> |
5 |
>> The best I've been able to do is a global setting in /etc/rc.conf: |
6 |
>> |
7 |
>> rc_ulimit="-s 1048576" |
8 |
>> |
9 |
>> The entries under /etc/security seem to be ignored when using |
10 |
>> `/etc/init.d/foo start`. |
11 |
> |
12 |
> If you are willing to try, systemd allows you to set not only the |
13 |
> limits for opened files, but also for basically every knob the Linux |
14 |
> kernel has. And to set it per daemon (or unit, in systemd parlance), |
15 |
> of course; for what you want, you would only need to set: |
16 |
> |
17 |
> LimitNOFILE=<limit> |
18 |
> |
19 |
> in the [Service] section of your unit. If you are interested, all the |
20 |
> relevant documentation is in systemd.exec(5). |
21 |
> |
22 |
|
23 |
This is our mail filtering gateway, so I probably won't be willing to |
24 |
try systemd until the next time we replace the hardware =) |
25 |
|
26 |
That does sound extremely useful though. I'm planning on converting my |
27 |
desktops after it gets a little bit more traction. |