On Mi, 01.11.17 19:07, 清辰 (624001...@qq.com) wrote:

> Hi Lennart,
> 
> For example, shell command: ulimit -Sn `ulimit -Hn`
> It will set soft limit to hard limit.
>
> I want to achieve it in systemd.unit.
> 
> Can you get my point?

This is not supported. But do note that the kernel sets RLIMIT_NOFILE
to 1024:4096 by default, and this is what systemd passes on to the
processes it forks off. Also note, that the resource limit code in
systemd will actually bump the limits to the configured value with a
fallback of the highest permitted limit if the requested one is
prohibited for some policy reason.

That means, if you set LimitNOFILE=4096 in your service, you get what
you are asking for.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to