<div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
You could invoke a man:systemd-run for each new process. Than you can<br>
put every single job in a seperate .slice with its own<br>
man:systemd.resource-control applied.<br>
This would also mean that you don't need to compile against libsystemd.<br>
Just exec() accordingly if a systemd-system is detected.<br>
<br>
BR<br>
Silvio<br></blockquote><div><br></div><div><div>Silvio,</div><div><br></div><div>As I commented in my previous post, creating every single job in a separate slice is an overhead I cannot assume.</div><div>An HTC system could run thousands of jobs per second, and doing extra fork+execs plus waiting for systemd to fill up its internal structures and manage it all is a no-no.</div><div><br></div><div>One other option that I am thinking about is extending the parameters of a unit file, for example adding a DelegateCgroupLeaf=yes option.<br></div><div><br></div><div>DelegateCgroupLeaf=<yes|no>. If set to yes an extra directory will be created into the unit cgroup to place the newly spawned service process. This is useful for services which need to be restarted while its forked pids remain in the cgroup and the service cgroup is not a leaf anymore. This option is only valid when using Delegate=yes and under a system in unified mode.<br></div><div><br></div><div>E.g. in my example, that would end up like this:<br></div><div>/sys/fs/cgroup/system.slices/sgamba1.service   <------ This is Delegated=yes DelegateMultiCgroups=yes<br>├── sgamba1   <------ The spawned process would be always put in here by systemd.<br>├── user1_stuff<br>├── user2_stuff<br>└── user3_stuff</div><div><br></div><div>I think this idea could work for cases like the one exposed here, and I see this would be quite useful.</div> </div></div></div>