[systemd-devel] ability to associate new process with cgroups of an RPC client

Lennart Poettering lennart at poettering.net
Mon Oct 20 13:01:41 PDT 2014


On Mon, 13.10.14 16:29, Darren Shepherd (darren.s.shepherd at gmail.com) wrote:

> I'm looking for guidance on how the following can be done with systemd or
> if there is a different approach.  Imagine I have a daemon that forks
> processes based on a RPC request.  If the deamon is running in
> daemon.service and the RPC client is running is session-42.scope.  I would
> like the daemon to be able to fork a new process in session-42.scope, or as
> a new cgroup that is a child of the callers cgroup.
> 
> >From what I understand of systemd is that the only way to create a process
> and put it in a cgroup is to create a transient unit with the PIDs
> property, but there seems to be no way to associate the transient unit with
> an existing cgroup.  I realize creating a transient unit in an existing
> cgroup may not make any sense because the unit no longer can use cgroups
> for grouping processes.  So it seems that there should be a different API
> of systemd to join a process to an arbitrary cgroup.

Yes, this is currently not available, but it probably makes sense to
allow this. I have for now added this to the TODO list.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list