cgroup lite postinst fails (init script doesn't start)

Bug #985884 reported by Thomas Bushnell, BSG
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cgroup-lite (Ubuntu)
Fix Released
High
Serge Hallyn
Precise
Fix Released
Undecided
Unassigned
Quantal
Fix Released
High
Serge Hallyn

Bug Description

============================================
SRU Justification:
1. Impact: Customized installations which mount cgroups in nonstandard
locations may cause cgroup-lite to fail to start correctly
2. Development fix: have cgroup-lite do nothing if cgroups are found mounted
anywhere at all
3. Stable fix: same as development fix.
4. Test case:
   Create an upstart job:
   {{{
   start on starting cgroup-lite
   pre-start script
     mkdir -p /mnt2
     mount -t cgroup -o freezer freezer /mnt2
   end script
   }}}
   reboot and check whether cgroup-lite is working. Manually try
   {{{
   stop cgroup-lite; start cgroup-lite
   }}}
   and check for errors
5. Regression potential: If a system has a mount with 'cgroup' in the
name which is not a cgroup mount, cgroup-lite will no longer mount cgroups.

============================================

Similar symptom to https://bugs.launchpad.net/ubuntu/+source/cgroup-lite/+bug/929381, but obviously a different issue:

$ sudo apt-get install cgroup-lite
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  cgroup-lite
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,490 B of archives.
After this operation, 46.1 kB of additional disk space will be used.
Selecting previously unselected package cgroup-lite.
(Reading database ... 241656 files and directories currently installed.)
Unpacking cgroup-lite (from .../cgroup-lite_1.1_all.deb) ...
Processing triggers for ureadahead ...
Setting up cgroup-lite (1.1) ...
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)

$ sudo start cgroup-lite
start: Job failed to start

$ ls -ld /usr/bin/cgroups-mount
-rwxr-xr-x 1 root root 850 Feb 9 00:56 /usr/bin/cgroups-mount

$ ls -ld /sys/fs/cgroup
drwxr-xr-x 2 root root 0 Apr 19 13:37 /sys/fs/cgroup

$ sudo /usr/bin/cgroups-mount
mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
mount: according to mtab, cgroup is mounted on /sys/fs/cgroup

$ echo $?
32

$ mount | grep cgroup
none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
none on /dev/cgroup/devices type cgroup (rw,devices)
cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)

$ sudo /usr/bin/cgroups-umount
umount: cpu: not mounted
umount: cpuacct: not found
umount: memory: not found
umount: devices: not found
umount: freezer: not found
umount: net_cls: not found
umount: perf_event: not found

$ mount | grep cgroup
none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
none on /dev/cgroup/devices type cgroup (rw,devices)

$ sudo /usr/bin/cgroups-mount
mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
mount: according to mtab, cgroup is mounted on /sys/fs/cgroup

$ echo $?
32

Revision history for this message
Steve Langasek (vorlon) wrote :

Hi Thomas,

Does this mean something else on your system had already mounted cgroups?

Revision history for this message
Thomas Bushnell, BSG (tbushnell) wrote : Re: [Bug 985884] Re: cgroup lite postinst fails (init script doesn't start)
Download full text (3.1 KiB)

I assume so. But I'm pretty sure we didn't do it. I'll grep when I'm back
at a keyboard in the morning. Still, package installation should never fail
for such a reason; this is a general problem with reflecting errors in unit
scripts back to postinst.
On Apr 19, 2012 7:40 PM, "Steve Langasek" <email address hidden>
wrote:

> Hi Thomas,
>
> Does this mean something else on your system had already mounted
> cgroups?
>
> --
> You received this bug notification because you are a member of Goobuntu
> Team, which is subscribed to the bug report.
> https://bugs.launchpad.net/bugs/985884
>
> Title:
> cgroup lite postinst fails (init script doesn't start)
>
> Status in “cgroup-lite” package in Ubuntu:
> New
>
> Bug description:
> Similar symptom to https://bugs.launchpad.net/ubuntu/+source/cgroup-
> lite/+bug/929381, but obviously a different issue:
>
> $ sudo apt-get install cgroup-lite
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following NEW packages will be installed:
> cgroup-lite
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> Need to get 0 B/3,490 B of archives.
> After this operation, 46.1 kB of additional disk space will be used.
> Selecting previously unselected package cgroup-lite.
> (Reading database ... 241656 files and directories currently installed.)
> Unpacking cgroup-lite (from .../cgroup-lite_1.1_all.deb) ...
> Processing triggers for ureadahead ...
> Setting up cgroup-lite (1.1) ...
> 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)
>
> $ sudo start cgroup-lite
> start: Job failed to start
>
> $ ls -ld /usr/bin/cgroups-mount
> -rwxr-xr-x 1 root root 850 Feb 9 00:56 /usr/bin/cgroups-mount
>
> $ ls -ld /sys/fs/cgroup
> drwxr-xr-x 2 root root 0 Apr 19 13:37 /sys/fs/cgroup
>
> $ sudo /usr/bin/cgroups-mount
> mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
> mount: according to mtab, cgroup is mounted on /sys/fs/cgroup
>
> $ echo $?
> 32
>
> $ mount | grep cgroup
> none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
> none on /dev/cgroup/devices type cgroup (rw,devices)
> cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)
>
> $ sudo /usr/bin/cgroups-umount
> umount: cpu: not mounted
> umount: cpuacct: not found
> umount: memory: not found
> umount: devices: not found
> umount: freezer: not found
> umount: net_cls: not found
> umount: perf_event: not found
>
> $ mount | grep cgroup
> none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
> none on /dev/cgroup/devices type cgroup (rw,devices)
>
> $ sudo /usr/bin/cgroups-mount
> mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
> mount: according to mtab, cgroup is mounted on /sys/fs/cgroup
>
> $ echo $?
> 32
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/cgroup-lite/+bug/985884/+subscriptio...

Read more...

Revision history for this message
Steve Langasek (vorlon) wrote :

On Fri, Apr 20, 2012 at 03:29:25AM -0000, Thomas Bushnell, BSG wrote:
> I assume so. But I'm pretty sure we didn't do it. I'll grep when I'm back
> at a keyboard in the morning. Still, package installation should never fail
> for such a reason; this is a general problem with reflecting errors in unit
> scripts back to postinst.

Well in the common case, packages that are expected to start a service at
install time need to report such errors so that dependent packages don't
fail with even more obscure errors. I don't know if that's appropriate here
or if we should indeed just be ignoring all errors from this job on package
install.

Was a /var/log/upstart/cgroup-lite.log file created? Could you post its
contents? It's possible the mount operation succeeded but the job failed
for some other reason.

Revision history for this message
Alec Warner (antarus) wrote :
Download full text (6.1 KiB)

On Thu, Apr 19, 2012 at 8:29 PM, Thomas Bushnell, BSG
<email address hidden> wrote:
> I assume so. But I'm pretty sure we didn't do it. I'll grep when I'm back
> at a keyboard in the morning. Still, package installation should never fail
> for such a reason; this is a general problem with reflecting errors in unit
> scripts back to postinst.

Thomas, our buildtools stuff does it.

-A

> On Apr 19, 2012 7:40 PM, "Steve Langasek" <email address hidden>
> wrote:
>
>> Hi Thomas,
>>
>> Does this mean something else on your system had already mounted
>> cgroups?
>>
>> --
>> You received this bug notification because you are a member of Goobuntu
>> Team, which is subscribed to the bug report.
>> https://bugs.launchpad.net/bugs/985884
>>
>> Title:
>>  cgroup lite postinst fails (init script doesn't start)
>>
>> Status in “cgroup-lite” package in Ubuntu:
>>  New
>>
>> Bug description:
>>  Similar symptom to https://bugs.launchpad.net/ubuntu/+source/cgroup-
>>  lite/+bug/929381, but obviously a different issue:
>>
>>  $ sudo apt-get install cgroup-lite
>>  Reading package lists... Done
>>  Building dependency tree
>>  Reading state information... Done
>>  The following NEW packages will be installed:
>>    cgroup-lite
>>  0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
>>  Need to get 0 B/3,490 B of archives.
>>  After this operation, 46.1 kB of additional disk space will be used.
>>  Selecting previously unselected package cgroup-lite.
>>  (Reading database ... 241656 files and directories currently installed.)
>>  Unpacking cgroup-lite (from .../cgroup-lite_1.1_all.deb) ...
>>  Processing triggers for ureadahead ...
>>  Setting up cgroup-lite (1.1) ...
>>  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)
>>
>>  $ sudo start cgroup-lite
>>  start: Job failed to start
>>
>>  $ ls -ld /usr/bin/cgroups-mount
>>  -rwxr-xr-x 1 root root 850 Feb  9 00:56 /usr/bin/cgroups-mount
>>
>>  $ ls -ld /sys/fs/cgroup
>>  drwxr-xr-x 2 root root 0 Apr 19 13:37 /sys/fs/cgroup
>>
>>  $ sudo /usr/bin/cgroups-mount
>>  mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
>>  mount: according to mtab, cgroup is mounted on /sys/fs/cgroup
>>
>>  $ echo $?
>>  32
>>
>>  $ mount | grep cgroup
>>  none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
>>  none on /dev/cgroup/devices type cgroup (rw,devices)
>>  cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)
>>
>>  $ sudo /usr/bin/cgroups-umount
>>  umount: cpu: not mounted
>>  umount: cpuacct: not found
>>  umount: memory: not found
>>  umount: devices: not found
>>  umount: freezer: not found
>>  umount: net_cls: not found
>>  umount: perf_event: not found
>>
>>  $ mount | grep cgroup
>>  none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
>>  none on /dev/cgroup/devices type cgroup (rw,devices)
>>
>>  $ sudo /usr/bin/cgroups-mount
>>  mount: cgroup already mounted or /sys/fs/cgroup/cp...

Read more...

Revision history for this message
Thomas Bushnell, BSG (tbushnell) wrote :
Download full text (3.2 KiB)

Ah yes. We do have something that has already mounted them. So it seems
that the start script should make sure things are mounted properly, but not
fail because they are already mounted...unless it's in the wrong place, or
in a conflicting manner. I don't think that's the case here, however.
On Apr 19, 2012 10:40 PM, "Steve Langasek" <email address hidden>
wrote:

> Hi Thomas,
>
> Does this mean something else on your system had already mounted
> cgroups?
>
> --
> You received this bug notification because you are a member of Goobuntu
> Team, which is subscribed to the bug report.
> https://bugs.launchpad.net/bugs/985884
>
> Title:
> cgroup lite postinst fails (init script doesn't start)
>
> Status in “cgroup-lite” package in Ubuntu:
> New
>
> Bug description:
> Similar symptom to https://bugs.launchpad.net/ubuntu/+source/cgroup-
> lite/+bug/929381, but obviously a different issue:
>
> $ sudo apt-get install cgroup-lite
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following NEW packages will be installed:
> cgroup-lite
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> Need to get 0 B/3,490 B of archives.
> After this operation, 46.1 kB of additional disk space will be used.
> Selecting previously unselected package cgroup-lite.
> (Reading database ... 241656 files and directories currently installed.)
> Unpacking cgroup-lite (from .../cgroup-lite_1.1_all.deb) ...
> Processing triggers for ureadahead ...
> Setting up cgroup-lite (1.1) ...
> 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)
>
> $ sudo start cgroup-lite
> start: Job failed to start
>
> $ ls -ld /usr/bin/cgroups-mount
> -rwxr-xr-x 1 root root 850 Feb 9 00:56 /usr/bin/cgroups-mount
>
> $ ls -ld /sys/fs/cgroup
> drwxr-xr-x 2 root root 0 Apr 19 13:37 /sys/fs/cgroup
>
> $ sudo /usr/bin/cgroups-mount
> mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
> mount: according to mtab, cgroup is mounted on /sys/fs/cgroup
>
> $ echo $?
> 32
>
> $ mount | grep cgroup
> none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
> none on /dev/cgroup/devices type cgroup (rw,devices)
> cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)
>
> $ sudo /usr/bin/cgroups-umount
> umount: cpu: not mounted
> umount: cpuacct: not found
> umount: memory: not found
> umount: devices: not found
> umount: freezer: not found
> umount: net_cls: not found
> umount: perf_event: not found
>
> $ mount | grep cgroup
> none on /dev/cgroup/cpu type cgroup (rw,cpu,cpuacct)
> none on /dev/cgroup/devices type cgroup (rw,devices)
>
> $ sudo /usr/bin/cgroups-mount
> mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
> mount: according to mtab, cgroup is mounted on /sys/fs/cgroup
>
> $ echo $?
> 32
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+s...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cgroup-lite (Ubuntu):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug.

The start script does check for cgroups already being mounted in the standard locations, but your scripts install them in a non-standard location which cgroup-lite wasn't checking for.

It should be fine to update the cgroup-lite upstart script to stop if cgroup shows up in /proc/mounts at all. That is probably the best fix.

Changed in cgroup-lite (Ubuntu):
importance: Undecided → High
assignee: nobody → Serge Hallyn (serge-hallyn)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
cgroup-lite (1.2) quantal; urgency=low

  * move cgroups-mount and cgroups-umount to /bin, with links in /usr
    (LP: #989354)
  * cgroups-mount: log and exit (with success) if any cgroup fs is mounted
    anywhere (LP: #985884)
  * cgroups-umount: be robust if /sys/fs/cgroup does not exist.
 -- Serge Hallyn <email address hidden> Wed, 20 Jun 2012 12:57:33 -0500

Changed in cgroup-lite (Ubuntu Quantal):
status: Confirmed → Fix Released
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Thomas, 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.1 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 change the bug tag from verification-needed to verification-done. If it does not, 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: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Could somebody with a setup to test the update check if it's indeed resolving the issue so it can be moved to -updates?

Revision history for this message
Alec Warner (antarus) wrote : Re: [Bug 985884] Re: cgroup lite postinst fails (init script doesn't start)
Download full text (4.1 KiB)

Sorry I'll do this today.

-A

On Mon, Jul 9, 2012 at 11:06 PM, Sebastien Bacher <email address hidden> wrote:
> Could somebody with a setup to test the update check if it's indeed
> resolving the issue so it can be moved to -updates?
>
> --
> You received this bug notification because you are a member of Goobuntu
> Team, which is subscribed to the bug report.
> https://bugs.launchpad.net/bugs/985884
>
> Title:
> cgroup lite postinst fails (init script doesn't start)
>
> Status in “cgroup-lite” package in Ubuntu:
> Fix Released
> Status in “cgroup-lite” source package in Precise:
> Fix Committed
> Status in “cgroup-lite” source package in Quantal:
> Fix Released
>
> Bug description:
> ============================================
> SRU Justification:
> 1. Impact: Customized installations which mount cgroups in nonstandard
> locations may cause cgroup-lite to fail to start correctly
> 2. Development fix: have cgroup-lite do nothing if cgroups are found mounted
> anywhere at all
> 3. Stable fix: same as development fix.
> 4. Test case:
> Create an upstart job:
> {{{
> start on starting cgroup-lite
> pre-start script
> mkdir -p /mnt2
> mount -t cgroup -o freezer freezer /mnt2
> end script
> }}}
> reboot and check whether cgroup-lite is working. Manually try
> {{{
> stop cgroup-lite; start cgroup-lite
> }}}
> and check for errors
> 5. Regression potential: If a system has a mount with 'cgroup' in the
> name which is not a cgroup mount, cgroup-lite will no longer mount cgroups.
>
> ============================================
>
> Similar symptom to https://bugs.launchpad.net/ubuntu/+source/cgroup-
> lite/+bug/929381, but obviously a different issue:
>
> $ sudo apt-get install cgroup-lite
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following NEW packages will be installed:
> cgroup-lite
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> Need to get 0 B/3,490 B of archives.
> After this operation, 46.1 kB of additional disk space will be used.
> Selecting previously unselected package cgroup-lite.
> (Reading database ... 241656 files and directories currently installed.)
> Unpacking cgroup-lite (from .../cgroup-lite_1.1_all.deb) ...
> Processing triggers for ureadahead ...
> Setting up cgroup-lite (1.1) ...
> 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)
>
> $ sudo start cgroup-lite
> start: Job failed to start
>
> $ ls -ld /usr/bin/cgroups-mount
> -rwxr-xr-x 1 root root 850 Feb 9 00:56 /usr/bin/cgroups-mount
>
> $ ls -ld /sys/fs/cgroup
> drwxr-xr-x 2 root root 0 Apr 19 13:37 /sys/fs/cgroup
>
> $ sudo /usr/bin/cgroups-mount
> mount: cgroup already mounted or /sys/fs/cgroup/cpu busy
> mount: according to mtab, cgroup is mounted on /sy...

Read more...

Revision history for this message
Alec Warner (antarus) wrote :

Verified.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Brandon Gilmore (bgilmore) wrote :

Is there any timeline wherein we can expect this fix to hit Precise?

Revision history for this message
Steve Langasek (vorlon) wrote :

cgroup-lite 1.1.2 is already in precise-updates. It looks like 1.1.2 may not have been uploaded with the right options to get this bug marked as fixed.

Changed in cgroup-lite (Ubuntu Precise):
status: Fix Committed → Fix Released
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.