#
#  Copyright IBM Corporation. 2007
#
#  Authors:	Balbir Singh <balbir@linux.vnet.ibm.com>
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of version 2.1 of the GNU Lesser General Public License
#  as published by the Free Software Foundation.
#
#  This program is distributed in the hope that it would be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
<%
case node[:platform_family]
when 'debian'
-%>
#group daemons/www {
#	perm {
#		task {
#			uid = root;
#			gid = webmaster;
#		}
#		admin {
#			uid = root;
#			gid = root;
#		}
#	}
#	cpu {
#		cpu.shares = 1000;
#	}
#}
#
#group daemons/ftp {
#	perm {
#		task {
#			uid = root;
#			gid = ftpmaster;
#		}
#		admin {
#			uid = root;
#			gid = root;
#		}
#	}
#	cpu {
#		cpu.shares = 500;
#	}
#}
#
mount {
	cpu = /mnt/cgroups/cpu;
	cpuacct = /mnt/cgroups/cpuacct;
	devices = /mnt/cgroups/devices;
}
<%
when 'rhel'
-%>
# See man cgconfig.conf for further details.
#
# By default, mount all controllers to /cgroup/<controller>

mount {
	cpuset	= /cgroup/cpuset;
	cpu	= /cgroup/cpu;
	cpuacct	= /cgroup/cpuacct;
	memory	= /cgroup/memory;
	devices	= /cgroup/devices;
	freezer	= /cgroup/freezer;
	net_cls	= /cgroup/net_cls;
	blkio	= /cgroup/blkio;
}
<% end -%>


group <%= node['hadoop']['yarn.nodemanager.linux-container-executor.cgroups.hierarchy'].gsub(/^\//, '') %> {
    perm {
        task {
            uid = yarn;
            gid = yarn;
        }
        admin {
            uid = yarn;
            gid = yarn;
        }
    }
    cpu {
    }
}

