3

systemd launches a process in the /system.slice/process-name.service cgroup. I would like to launch the process in a different cgroup. I can do this using cgexec in the ExecStart option, but is there a better way?

Jeff Kubina
  • 397
  • 1
  • 3
  • 12

1 Answers1

4

Creat a group-name.slice, and set the resource control configuration in the slice unit, such as, CPUShares=, MemoryLimit=.

Then set Slice=group-name.slice in the process-name.service.

See man systemd.resource-control for details.

Shuangistan
  • 156
  • 3