system-config/modules/jenkins/templates/cgconfig.erb
Jeremy Stanley f823469514 Fix cgconfig.conf comments.
* modules/jenkins/templates/cgconfig.erb: The cgconfig service does
not handle comment lines and fails to start. There is little benefit
to embedding comments into the resulting configuration file anyway,
so instead just make them ruby comments within the template.

Change-Id: Ie749acfcd231560094137e82e048726d04944b4e
Reviewed-on: https://review.openstack.org/35715
Reviewed-by: Khai Do <zaro0508@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Elizabeth Krumbach Joseph <lyz@princessleia.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2013-07-12 22:48:07 +00:00

62 lines
1.4 KiB
Plaintext

<% if operatingsystem == "Fedora" then
# Fedora auto-mounts subsystems under /sys/fs/cgroup/ already, so no
# mount section is needed. %>
<% elsif osfamily == "RedHat" then %>
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;
}
<% elsif ( operatingsystemrelease < '12.10' ) or ( operatingsystem != 'Ubuntu' ) then %>
mount {
cpu = /sys/fs/cgroup/cpu;
cpuacct = /sys/fs/cgroup/cpuacct;
devices = /sys/fs/cgroup/devices;
memory = /sys/fs/cgroup/memory;
freezer = /sys/fs/cgroup/freezer;
}
<% end %>
group jenkins {
perm {
task {
uid = jenkins;
gid = jenkins;
}
admin {
uid = root;
gid = root;
}
}
}
group jenkins/children {
perm {
task {
uid = jenkins;
gid = jenkins;
}
admin {
uid = root;
gid = root;
}
}
memory {
memory.soft_limit_in_bytes = <%= (memorytotalbytes.to_f * 0.75).to_i %>;
memory.limit_in_bytes = <%= (memorytotalbytes.to_f * 0.9).to_i %>;
<% if (operatingsystem == "Fedora") and (operatingsystemrelease == "18") then
# Because of Red Hat bug 918951, swap management doesn't
# work in Fedora 18 but should be fixed in 19. %>
<% else %>
memory.memsw.limit_in_bytes = <%= (memorytotalbytes.to_f * 0.9).to_i %>;
<% end %>
}
}