[systemd-devel] Moving a service from one systemd slice to another..

Lennart Poettering lennart at poettering.net
Thu May 7 07:36:18 UTC 2020


On Do, 07.05.20 09:21, Tomasz Torcz (tomek at pipebreaker.pl) wrote:

> On Thu, May 07, 2020 at 08:56:24AM +0200, Lennart Poettering wrote:
> > > > >  Is there an API in systemd to move specific program to a dedicated
> > > > >  slice?
> > > >
> > > > Use Slice= in the service file.
> > >
> > >   That would require having a service file.  I don't have it. I just have a
> > > single process in session which I need to treat specially.  Thus I move
> > > it to separate slice.  I have /etc/systemd/system/kodi.slice to define
> > > this separate slice and resource controls for it.
> >
> > use "systemd-run --scope --slice=kodi.slice …" for that.
>
>   That's not moving, that's starting a new instance.

Yeah. Moving is not supported. As mentioned.

>
> > Really, if you muck around with the cgroup tree yourself you void all
> > warranty. I mean, it's Linux you can do whatever you want, but it's
> > certainly outside of how this is intended to be used, i.e. the
> > cgroupsv2 "single writer" concept.
> >
> > Please read up on this here:
> >
> > https://systemd.io/CGROUP_DELEGATION
> > It's documented in all length...
>
>   From quick glance, it talks about a bit different concepts.
> I'm not delegating, I'm using systemd to manage tree for me.
> There are no multiple writers - only systemd (no kubernetes and
> such).

Well, if you manually muck with the cgroup tree, then *you* are the
second writer.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list