cgroup-lite fails to install in container in precise

Bug #1257857 reported by Serge Hallyn
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cgroup-lite (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

====================================
SRU Justification
1. Impact: apt-get install cgroup-lite fails
2. Development fix: /bin/cgroup-mount was changed quite a bit to not fail
3. Stable fix: some of the devel fixes are not appropriate. So instead, just do '/bin/cgroup-mount || { stop; exit 0 } in the upstart job
4. test case:
 sudo apt-get -y install lxc
 sudo lxc-create -t ubuntu -n p1 -- -r precise
 sudo lxc-start -n p1
   # log in
   sudo apt-get -y install cgroup-lite
          # this will fail
5. Regression potential: users may now think that cgroups are available for use (i.e. by lxc) when in fact they are not.

In a stock apparmor-protected container on precise, apt-get install cgroup-lite fails.

This is because it cannot mount cgroups.

Discussion on irc suggests the best fix is to make the cgroup-lite upstart job {stop; exit 0;} if /bin/mount-cgroup fails. That way package install will succeed, but the
upstart job won't be running, which users can detect.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This was fixed some time ago in more recent releases, inadvertently by working around the fact that /sys/fs/cgroups/* may have been already mounted by cgroup-bin.

Changed in cgroup-lite (Ubuntu Precise):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Serge Hallyn (serge-hallyn)
Changed in cgroup-lite (Ubuntu):
status: New → Fix Released
importance: Undecided → High
description: updated
Changed in cgroup-lite (Ubuntu Precise):
assignee: Serge Hallyn (serge-hallyn) → nobody
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Serge, or anyone else affected,

Accepted cgroup-lite into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cgroup-lite/1.1.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cgroup-lite (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Simon Déziel (sdeziel) wrote :

The -proposed package fails to install. Adding "set -x" to the postinst script gives this:

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up cgroup-lite (1.1.3) ...
+ [ -e /etc/init/cgroup-lite.conf ]
+ invoke-rc.d cgroup-lite start
start: Job failed to start
invoke-rc.d: initscript cgroup-lite, action "start" failed.
+ exit 1
dpkg: error processing cgroup-lite (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 cgroup-lite
E: Sub-process /usr/bin/dpkg returned an error code (1)

# cat /var/log/upstart/cgroup-lite.log
mount: special device cgroup does not exist
/proc/self/fd/9: 4: /proc/self/fd/9: {stop: not found
umount: memory: not mounted

tags: added: verification-failed
removed: verification-needed
Revision history for this message
Simon Déziel (sdeziel) wrote :

Note that I use the boot command line "cgroup_disable=memory" but I don't know if that alone is explaining the problem.

Revision history for this message
Simon Déziel (sdeziel) wrote :

Not using "cgroup_disable=memory" fixed the issue:

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up cgroup-lite (1.1.3) ...
+ [ -e /etc/init/cgroup-lite.conf ]
+ invoke-rc.d cgroup-lite start
+ update-rc.d -f cgroup-lite remove

Since the problem was caused by a manually added boot option, I'm not sure it should fail verification. Please feel free to mark it "verification-done" if deemed appropriate.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1257857] Re: cgroup-lite fails to install in container in precise

Hi,

this actually didn't seem to fix it for me. Sorry, I need to dig a
bit deeper and ask some questions.

In particular, the new version, after package installation, handles
'start/stop' the way I'd expect. But the package install itself appears
to be failing when the upstart job tries to start and does {stop; exit 0}

I'll look at this more tomorrow and see if I made a mistake in my
testing.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Quoting Brian Murray (<email address hidden>):
> Hello Serge, or anyone else affected,
>
> Accepted cgroup-lite into precise-proposed. The package will build now

Hi Brian,

this package did not fix the problem. I've pushed two new versions of
1.1.4 for precise-proposed, however I've decided they are not right
either. I will push a new version of 1.1.4 which pulls all the
/bin/cgroups-mount changes from trusty.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I've pushed a new version of 1.1.4, with changelog:

 cgroup-lite (1.1.4) precise-proposed; urgency=medium
 .
   * debian/cgroup-lite.upstart: undo 1.1.3 changes
   * scripts/*: pull in changes from trusty to make the scripts more
     robust to previous mounts and/or mount failures.
 .
 cgroup-lite (1.1.3) precise-proposed; urgency=low
 .
   * debian/cgroup-lite.upstart: stop and exit 0 if mount-cgroups failed.
     (LP: #1257857)

Please accept it and drop 1.1.3 and the two other (earlier) 1.1.4's.

Sorry for how much work this is turning into.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Serge, or anyone else affected,

Accepted cgroup-lite into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cgroup-lite/1.1.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-failed
tags: added: verification-needed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks - this fixed it for me.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cgroup-lite - 1.1.4

---------------
cgroup-lite (1.1.4) precise-proposed; urgency=medium

  * debian/cgroup-lite.upstart: undo 1.1.3 changes
  * scripts/*: pull in changes from trusty to make the scripts more
    robust to previous mounts and/or mount failures.

cgroup-lite (1.1.3) precise-proposed; urgency=low

  * debian/cgroup-lite.upstart: stop and exit 0 if mount-cgroups failed.
    (LP: #1257857)
 -- Serge Hallyn <email address hidden> Wed, 18 Dec 2013 11:48:47 -0600

Changed in cgroup-lite (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of the Stable Release Update for cgroup-lite has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
gizero (gizero-gmail) wrote :

Upgrading ubuntu server 12.04 today still fails with the following:

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up cgroup-lite (1.1.4) ...
start: Job failed to start
invoke-rc.d: initscript cgroup-lite, action "start" failed.
dpkg: error processing cgroup-lite (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 cgroup-lite
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also reported at http://askubuntu.com/questions/401268/dpkg-error-processing-cgroup-lite-configure#new-answer?newreg=4db336bfa0b248e2965009cec7186ee8

Revision history for this message
Michael Schaller (misch-9) wrote :

Workaround / Fix:

$ sudo sed -i 's|{stop|{ stop|g' /etc/init/cgroup-lite.conf

$ sudo dpkg --configure cgroup-lite
Setting up cgroup-lite (1.1.4) ...
cgroup-lite start/running

Revision history for this message
Eduard Hasenleithner (eduard-hasenleithner) wrote :

Upgrade fails also for me.

Revision history for this message
kapsi (kapsi-precise) wrote :

It seems, that there is a missing whitespace in the config file ;)

Thanks to Michael Schaller (misch-9)!

Revision history for this message
Diego Amor (diegoamor) wrote :

misch-9 confirmed!!! is the white space!!!

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hm, I can't reproduce this. The existing package starts fine for me.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The whitespace fix has been queued for a hopefully quick SRU - however for you to hit this means you'll likely still have a (unfathomable to me) case where /bin/cgroups-mount is returning an error. If/when that happens, please do open a new bug.

Revision history for this message
Philipp Kern (pkern) wrote :

Another bug has been opened for this regression: https://bugs.launchpad.net/ubuntu/+source/cgroup-lite/+bug/1266993 — Serge, is the SRU tracked in a bug?

Revision history for this message
kapsi (kapsi-precise) wrote :

Whitespace bug is fixed with a new update.
Thanks

Revision history for this message
Philipp Kern (pkern) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1257857] Re: cgroup-lite fails to install in container in precise

> Serge, is the SRU tracked in a bug?

No, the fix was pushed before one of the separate bugs was opened.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.