[systemd-devel] MemoryLimit for user unit

Lennart Poettering lennart at poettering.net
Mon Nov 13 09:12:52 UTC 2017


On So, 12.11.17 18:14, Stefan Schweter (stefan at schweter.it) wrote:

> Hi systemd-users,
> 
> I tried to add a memory limit for a user service unit (inspired by [1]),
> it looks like:
> 
> [Service]
> # ....
> MemoryAccounting=true
> MemoryLimit=1G
> 
> Now the problem is that the (user) service consumes more than 1G without
> being terminated.

Note that on cgroupsv1 delegation of controllers to unprivileged
code is not safe and hence systemd won't do it. That means you have to
boot in cgroupsv2 mode (i.e. "unified") to get any controller support
at all for the user systemd instance.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list