Supervisor event listener for configuring cgroups with processes managed by supervisor
Event listener (~plugin) for [supervisor](https://github.com/Supervisor/supervisor) that enables tying supervisor processes to cgroup hierarchy. Intended to be used as a replacement for [cgrules.conf](http://linux.die.net/man/5/cgrules.conf).
### Install and confugure
pip install supervisor_cgroups
Add an event listener to supervisor configuration files (e.g. to /etc/supervisor/conf.d/cgroups.conf):
[eventlistener:cgroups] command=supervisor_cgroups_listen –prefix CGROUPS_PREFIX PROCESS_NAME1@HIERARCHY1:GROUP1 PROCESS_NAME2@HIERARCHY2:GROUP2 etc… events=EVENT autostart=true autorestart=true
where PROCESS_NAME is a name of a process known to supervisor (as in [program:***]), HIERARCHY is a [cgroups hierarchy](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-Creating_a_Hierarchy_and_Attaching_Subsystems.html), GROUP stands for [control group](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-Creating_Cgroups.html) and CGROUPS_PREFIX is an optional path prefix where you prefer to store your cgroups hierarchies (/cgroup by default). All of these are supposed to be configured beforehand (with [cgconfig.conf](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/ch-Using_Control_Groups.html#The_cgconfig.conf_File) or otherwise).
### Known pitfails
Keep in mind that due to [a bug in supervisor](https://github.com/Supervisor/supervisor/issues/339) you have to reload supervisor to update the configuration; supervisorctl update won’t do.