5

I recenty upgraded a release from 12.04 to 14.04, and found out that my cgconfig.conf file is not being read anymore on startup.

The file appears to be correct, in the sense that I can explicitly load it with

sudo cgconfigparser -l /etc/cgconfig.conf

but this doesn't happen automatically on reboot, which means other scripts run on startup fail (because they rely on cgexec with groups defined in cgconfig.conf).

Is there something I need to do to have the file automatically used? (i.e. install some package) Do I have to somehow convert this file to some other ?

This used to work correctly before the upgrade, so I am confused as to what might be wrong.

The "cgroup-lite" package, which I think should be responsible for this, is also installed.

Thanks in advance.

riffraff
  • 103

1 Answers1

4

This looks like a regression due to the fix for bug #1096771. There were some init scripts in cgroup-bin in 12.04, which were removed in 13.04. The /etc/init/cgconfig.conf service file contained this in the pre-start script stanza:

/usr/sbin/cgconfigparser -l $CGCONFIG

So it was the cgconfig service from the cgroup-bin package that actually set up your cgroup configuration. cgroup-lite hasn't changed much in between these releases, so I assume it isn't meant to read this configuration. I recommend that you open a bug report (and perhaps write a new Upstart service (or copy the old one) since it's unlikely they'll change this in an LTS release).


Since 12.04 is still supported, you can use the Packages index to download the older version of the package. I have reproduced /etc/init/cgconfig.conf here for convenience:

description "cgconfig"
author "Serge E. Hallyn <serge.hallyn@ubuntu.com>"

start on runlevel [2345]

console output

pre-start script
    test -x /usr/sbin/cgconfigparser || { stop; exit 0; }

    CREATE_DEFAULT="yes"
    CGCONFIG=/etc/cgconfig.conf
    if [ -r /etc/default/cgconfig ]; then
        . /etc/default/cgconfig
    fi

    # If we've already run, don't do it again!
    if grep -q /sys/fs/cgroup /proc/mounts; then
        stop
        exit 0
    fi

    [ -r $CGCONFIG ] || { echo "$CGCONFIG is empty"; stop; exit 0; }

    mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroups /sys/fs/cgroup
    /usr/sbin/cgconfigparser -l $CGCONFIG
    if [ "$CREATE_DEFAULT" = "yes" ]; then
        /usr/sbin/create_default_cgroups
    fi
end script

post-stop script
    if [ -x /usr/sbin/cgclear ]
    then
        /usr/sbin/cgclear
    fi
    umount /sys/fs/cgroup || true
end script
muru
  • 197,895
  • 55
  • 485
  • 740
  • thanks, the answer makes sense so I'm accepting it, but if you could point me to a url where I could see how the old service looked like I'd be extra grateful (I'm apparently too stupid to get to the source code from the launchpad issue) – riffraff Oct 03 '14 at 07:56
  • 1
    @riffraff I have updated the answer with a link from where you can download the package. I had made a mistake - the service was called cgconfig and not cgroup. Sorry about that. – muru Oct 03 '14 at 08:38