[systemd-devel] unable to attach pid to service delegated directory in unified mode after restart

Michal Koutný mkoutny at suse.com
Wed Mar 16 16:49:47 UTC 2022


On Wed, Mar 16, 2022 at 05:30:22PM +0100, Felip Moll <felip at schedmd.com> wrote:
> That's not exact. If slurmd (my main process) forks a slurmstepd (child
> process) and I want to move slurmstepd into a delegated subtree from the
> scope I already created, I must use AttachProcessesToUnit(), isn't that
> true?

Just a sidenote, I'd suggest the idiom: fork,migrate,exec (in this
synchronous order) to make sure the new program runs under the target
cgroup.

> Or are you saying that I can just migrate processes wildly without
> informing systemd and just doing an 'echo > cgroup.procs' from one
> non-delegated tree to my delegated subtree?

I'd still recommend going through the API. Or at least migrate between
two delegated subtrees.
(As I hinted in my previous message, bypassing API makes sense only with
the unified cgroup mode and you must be privileged to do this.)


Michal


More information about the systemd-devel mailing list