[Bug 995956] [NEW] cgconfig upstart job should start earlier and mount all available cgroup types by default

urusha 995956 at bugs.launchpad.net
Mon May 7 13:48:43 UTC 2012


Public bug reported:

ubuntu 12.04 LTS, amd64
cgroup-bin                             0.37.1-1ubuntu10

1. cgconfig upstart job should start earlier.
/etc/init/cgconfig.conf contains this:
  start on runlevel [2345]
but should contain this (like cgroup-lite.conf does)
  start on mounted MOUNTPOINT=/sys

Why it's needed?  Imagine, I want cupsd to start with memory limit (cgroup called daemon-cups). To do this I edited configs:
/etc/cgconfig.conf
group daemon-cups {
    memory {
	memory.limit_in_bytes = 50M;
    }
}

 /etc/cgrules.conf
   root:/usr/sbin/cupsd	memory		daemon-cups

Now, after computer rebooted, I can see that daemon-cups cgroup is created but cupsd isn't in daemon-cups cgroup tasks. It appears there only after:
  service cups restart

That's because cups service started earlier than cgred service (and cgred service starts on started cgconfig).
Than imagine what if lxc will somehow start earlier than cgconfig? No, it won't start at all. So, I think this should be fixed.

2. cgconfig should mount all available cgroup types by default.
Default /etc/cgconfig.conf contains these:
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;
}

What if I  want to use LXC on the same machine and one container's config contains something like this:
  lxc.cgroup.cpuset.cpus = 1
Container will not start, because this cgroup type is not mounted by default with cgroup-bin package.
I think, the best way to fix this is to mount available cgroup fsystems via upstart job (the way cgroup-lite does it).  Another way is to change default /etc/cgconfig.conf (add mountpoints). But I would prefer the first solution (it's kernel independent).

3. After all these I'm asking you what is the reason of separation
cgroup-bin and cgroup-lite into different packages. Why not to just
disable cgrulesengd, cgconfigparser by default (using /etc/default
somehow)? For example, if I'm using LXC, I will likely be using
cgget/cgset or something.  And even if won't be using it what's wrong
with that these binaries are in my /usr/bin (100Kb)?

P.S.  cgconfig.conf : cpu = /sys/fs//cgroup/cpu; I believe double
slashes isn't needed here.

Thanks, hope it'll be fixed in LTS.

** Affects: libcgroup (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libcgroup in Ubuntu.
https://bugs.launchpad.net/bugs/995956

Title:
  cgconfig upstart job should start earlier and mount all available
  cgroup types by default

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libcgroup/+bug/995956/+subscriptions



More information about the Ubuntu-server-bugs mailing list