[systemd-devel] Question about the systemd slice hierarchy

Matthew Chae Matthew.Chae at axis.com
Tue Jul 1 16:01:09 UTC 2025


Hi Michal,

Thank you for your reply. I can grasp the point.
Please let me ask more questions if I think of any.
Besides, I will fix the name of slice in the picture soon.

BR-Matthew

________________________________
From: Michal Koutný
Sent: Monday, June 30, 2025 1:45 PM
To: Matthew Chae
Cc: systemd-devel at lists.freedesktop.org; Christopher Wong; Fredrik Hugosson; Umut Tezduyar Lindskog
Subject: Re: [systemd-devel] Question about the systemd slice hierarchy

Hello.

On Mon, Jun 30, 2025 at 07:45:53AM +0000, Matthew Chae <Matthew.Chae at axis.com> wrote:
> I have some questions about "Example 1. Enabling and disabling controllers" from the slice-related man page linked below.
> https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html#
>
> First, under system.slice, there is a slice named b.slice. Is this possible?

No, the name encodes the path in reality.

> Shouldn't it be named system-b.slice instead?

That would be indeed the proper name of the slice that is pictured
there. You can fix it here [1] :-)

> Second, under user.slice, there's a user at 1000.service, and under that,
> there are app.slice and session.slice.

If you check user at .service definition, you find that it sets Delegate=
-- this means that the service as seen from PID1 perspective was
delegated the manipulation of its (service's) cgroup subtree.

> Can a slice like app.slice exist under a service unit like user at 1000.service?

This app.slice is a slice unit of the _user_ instance of systemd. It's
full system path would be:
        /user.slice/user-1000.slice/user at 1000.service/app.slice

(app.slice is a random internal subcgroup for PID1)

> If that's possible, what would be a use case for this kind of structure?

It's turtles all the way down. One use case is structuring of processes
by user's desktop environment, some more info is in [2].

HTH,
Michal


[1] https://github.com/systemd/systemd/blob/main/man/systemd.resource-control.xml
[2] https://systemd.io/DESKTOP_ENVIRONMENTS/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20250701/7935ad61/attachment.htm>


More information about the systemd-devel mailing list