CGCLASSIFY(1)

πŸŽ€ CGCLASSIFY β€” the libcgroup girlie's guide

okay bestie, welcome to cgclassify, a page straight out of the libcgroup Manual. she's the girl who picks up your already-running processes and yeets them into whatever cgroups you tell her to. no restart, no drama, just relocation. πŸ’…


✨ SYNOPSIS ✨

cgclassify [-b] [-g <controllers>:<path>] [--sticky | --cancel-sticky]
<pidlist>

πŸ’– DESCRIPTION πŸ’–

so like, this command moves processes β€” the ones you list out in pidlist β€” into the control groups you specify. that's it, that's the whole job. 🫢

the pids in the pidlist are separated by spaces. just spaces. nothing fancy, no commas, no vibes-based delimiters.

  • -b β€” this one ignores the default systemd delegated hierarchy path and constructs the path of the control groups relative to the cgroup root hierarchy instead. like, forget the delegated route, we're going from the root, periodt.
  • -g <controllers>:<path> β€” this defines the control groups where the task will get moved to. controllers is a list of controllers and path is the relative path to control groups in the given controllers list.

you can use this flag multiple times to define multiple pairs of lists of controllers and relative paths. iconique, honestly. and instead of listing all the mounted controllers one by one, you can just use the wildcard *. yes, the star. she's that girl. ⭐

if you don't use this option at all, then cgclassify will automatically move the task to a control group based on /etc/cgrules.conf. so it's not like you're stranded, she's got a default plan for you.

  • -r β€” Replaces systemd scope's idle process with the first process of the list of process (pidlist). the first one. the main character of your pid list. πŸ‘‘
  • --sticky β€” if you use this, the daemon of service cgred (the cgrulesengd process) does not change both the specified pidlist and their children tasks. like, it leaves the whole family alone. without this option, the daemon does not change the specified pidlist but it automatically changes their child tasks to the right cgroup based on /etc/cgrules.conf. so default behaviour = the kids get reassigned, the parents don't. 🧚
  • --cancel-sticky β€” if you use this one, the daemon of service cgred (the cgrulesengd process) can automatically change both the specified pidlist and their child tasks to the right cgroup based on /etc/cgrules.conf. everybody's getting moved, no exceptions, no cap. πŸ’€

🌈 ENVIRONMENT VARIABLES 🌈

  • CGROUP_LOGLEVEL β€” controls verbosity of the tool. Allowed values are DEBUG, INFO, WARNING or ERROR. so pick your noise level, babe.

🌸 FILES 🌸

  • /etc/cgrules.conf β€” default libcgroup configuration file
  • /etc/cgrules.d β€” default libcgroup configuration files directory

πŸ¦‹ EXAMPLES πŸ¦‹

  • cgclassify -g cpu:student 1234 β€” moves process with pid number 1234 to control group student in cpu hierarchy. ✨
  • cgclassify 1234 β€” moves process with pid number 1234 to control groups based on /etc/cgrules.conf configuration file. the default route, no thoughts head empty, she handles it.
  • cgclassify --sticky -g cpu:/student 1234 β€” moves process with pid number 1234 to control group student in cpu hierarchy. The daemon of service cgred does not change cgroups of pid 1234 and its children (based on /etc/cgrules.conf). sticky mode: nobody gets moved after, not even the kids. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

cgrules.conf (5), cgexec (1)


okay that's the whole page, you ate, go move some processes. πŸ’–

libcgroup Manual Β· Linux Β· 2009-03-15 Β· this is the CGCLASSIFY(1) era and we're living in it. mwah. πŸŽ€

πŸ“¦ where this page comes from