Comment 4 for bug 1405256

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1405256] Re: Package does not contain service file

So I think long term (i.e. 16.04 and later) this will become a job for
systemd. What I'm not sure about is whether in the meantime we want
to implement another generic way of achieving this, or simply show
how to do it manually. I personally think the simplest thing to do
would be to create an upstart job that creates the cgroups you want.
For instances if you want a Web cgroup in the memory, cpuset, and
freezer hierarchies, owned by uid 100, with certain constraints, and you
have cgmanager and cgmanager-utils installed, you could create
/etc/init/setup-cgroups.conf containing (untested):

description "set up initial cgroups"
task
start on started cgmanager

script
 cgm movepidabs all / $$
 cgm create freezer Web
 cgm create memory Web
 cgm create cpuset Web
 cgm setvalue cpuset Web cpuset.cpus "0-1"
 cgm setvalue cpuset Web cpuset.mems "0"
 cgm chown freezer Web 1000 1000
 cgm chown memory Web 1000 1000
 cgm chown cpuset Web 1000 1000
end script