[systemd-devel] systemd put it uinder a custom slice

Lennart Poettering lennart at poettering.net
Thu Oct 31 11:02:41 UTC 2019


On Mi, 30.10.19 11:08, Bhasker C V (bhasker at unixindia.com) wrote:

> Hi all,
>
>  I have been googl-ing for a few days now but could not stumble upon a
> solution I am looking for.
>
> Apologies if this is a noob question.
>
> Is there a way to use custom slices with my systemd-nspawn container ?
>
> I see that systemd-nspawn man page says using --slice= but any such
> cgroup created is not accepted by this option (I dont know how to create
> a slice externally from systemd unit-files)
>
> $ sudo cgcreate  -g freezer,memory:/test

This is not supported.

systemd owns the cgroup tree, only subtrees for which delegation is
explicitly turned on can be managed by other programs, for example for
the purpose of container managers.

Thus, creating cgroups manually, directly via cgcreate at the top of
the tree is explicitly not supported.

Use systemd's own concepts, i.e. slice units, direct cgroup access
bypassing systemd at the top of the tree is explicitly not supported.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list