Name

move-to-control-group — move process to another control group then chain

Synopsis

move-to-control-group {group} {next-prog}

Description

move-to-control-group is a chain-loading utility that sets the single (relevant) process control group to group and then chain loads to next-prog with the execvp(3) function.

On platforms where /proc/self/cgroup does not exist, this command is a no-op and just chain loads, for script compatibility. Otherwise, that file is searched for a control group record with a blank controller field or (failing that) with a name=systemd controller field.

If a record of the former type is found, version 2 control groups are assumed with the single control group hierarchy rooted at /sys/fs/cgroup. If a record of the latter type is found, version 1 control groups are assumed with the relevant control group hierarchy (the only one that is affected by the command) rooted at /sys/fs/cgroup/systemd.

If group does not exist, move-to-control-group attempts to create it with mkdir(3). The command will fail if the process is not allowed to move to the given control group, or cannot create it.

next-prog may contain its own command line options, which move-to-control-group will ignore.

See also

  • create-control-group(1)

  • delegate-control-group-to(1)

  • set-control-group-knob(1)

Author

Jonathan de Boyne Pollard