lxc-clone shouldn't add fstab line if it wasn't there originally

Bug #1084089 reported by Serge Hallyn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned
Quantal
Fix Released
High
Unassigned
Raring
Fix Released
High
Unassigned

Bug Description

======================
SRU Justification:
1. Impact: lxc-clone can produce non-functional containers
2. Development fix: fix lxc-clone's handling of updates to lxc.mount entries.
3. Stable fix: same as development fix
4. Test case:
   lxc-create -t ubuntu -n c1
   sudo sed -i 's/lxc.mount =/lxc.mount =/' /var/lib/lxc/c1/config
   sudo lxc-clone -o c1 -n c2
   grep fstab /var/lib/lxc/c2/config
5. Regression potential: only lxc-clone is updated, so regressions would be
   contained in lxc-clone and in the code which is already broken for updating
   lxc.mount.
======================

Rene K. Mueller reports that when an original container does not have an fstab, lxc-clone still adds a 'lxc.mount = ..../fstab' line, breaking container start.

Related branches

Changed in lxc (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Stéphane Graber (stgraber) wrote :

While fixing this one, can you also have lxc-clone properly change the lxc.mount line to point to the clone (if lxc.mount exists for the source).
I thought that was done, but apparently not, I spent half an hour yesterday trying to figure out why a container was ignoring new fstab entries, before noticing that lxc.mount was pointing at another container...

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1084089] Re: lxc-clone shouldn't add fstab line if it wasn't there originally

Quoting Stéphane Graber (<email address hidden>):
> While fixing this one, can you also have lxc-clone properly change the lxc.mount line to point to the clone (if lxc.mount exists for the source).

Are you sure? I looked at the code before filing this and it was doing the right thing, using Dwight's patch.

> I thought that was done, but apparently not, I spent half an hour yesterday trying to figure out why a container was ignoring new fstab entries, before noticing that lxc.mount was pointing at another container...

I'll take a look, thanks. (Not sure I'm getting to this bug today though)

Revision history for this message
Stéphane Graber (stgraber) wrote :

Well, I did a lxc-clone yesterday using a daily build of the staging tree and it definitely was still pointing at the source.
Now maybe we have some patch in Ubuntu that's not in staging and that fixes that, or staging recently regressed, not sure...

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

Actually it's a bit worse than that. The code in the package was not fixed quite the same way as upstream. Instead of looking for 'lxc.mount[ \t]', it looks for any 'lxc.mount'. If found it removes all those entries and adds a new fstab entry. The problem is that the lxc.conf always can have 'lxc.mount.entry' lines, which will be deleted and replaced by an fstab line in the clone.

Changed in lxc (Ubuntu Precise):
status: New → Triaged
Changed in lxc (Ubuntu Quantal):
status: New → Triaged
Changed in lxc (Ubuntu Precise):
importance: Undecided → Medium
Changed in lxc (Ubuntu Quantal):
importance: Undecided → Medium
Changed in lxc (Ubuntu Raring):
importance: Medium → High
Changed in lxc (Ubuntu Quantal):
importance: Medium → High
Changed in lxc (Ubuntu Precise):
importance: Medium → High
tags: added: needssru
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu46

---------------
lxc (0.8.0~rc1-4ubuntu46) raring; urgency=low

  * 0229-lxc-clone-mount-fix: fix wrong handling of lxc.mount entries in
    lxc-clone. (LP: #1084089)
  * debian/apparmor/abstractions-lxc-container-base: deny read/write under
    /sys/firmware/efi/efivars.
 -- Serge Hallyn <email address hidden> Wed, 28 Nov 2012 11:04:17 -0600

Changed in lxc (Ubuntu Raring):
status: Triaged → Fix Released
Changed in lxc (Ubuntu Quantal):
assignee: nobody → Serge Hallyn (serge-hallyn)
status: Triaged → In Progress
Changed in lxc (Ubuntu Precise):
status: Triaged → In Progress
assignee: nobody → Serge Hallyn (serge-hallyn)
description: updated
Changed in lxc (Ubuntu Precise):
assignee: Serge Hallyn (serge-hallyn) → nobody
Changed in lxc (Ubuntu Quantal):
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 lxc into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/lxc/0.8.0~rc1-4ubuntu39 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 lxc (Ubuntu Quantal):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in lxc (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Serge, or anyone else affected,

Accepted lxc into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/lxc/0.7.5-3ubuntu66 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!

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

Confirmed in precise.

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

Confirmed in quantal

tags: added: verification-done
removed: needssru verification-needed
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update 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
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-3ubuntu66

---------------
lxc (0.7.5-3ubuntu66) precise-proposed; urgency=low

  [ William Grant ]
  * lxc-start-ephemeral: exit with the command's status, not always 0.
    (LP: #1050351)

  [ Serge Hallyn ]
  * 0227-ubuntu-cloud-parsing: fix some option parsing bugs in ubuntu-cloud
    template (LP: #1076031)
  * 0229-lxc-clone-mount-fix: fix wrong handling of lxc.mount entries in
    lxc-clone. (LP: #1084089)
 -- Serge Hallyn <email address hidden> Thu, 29 Nov 2012 12:43:44 -0600

Changed in lxc (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu39

---------------
lxc (0.8.0~rc1-4ubuntu39) quantal-proposed; urgency=low

  * 0227-ubuntu-cloud-parsing: fix some option parsing bugs in ubuntu-cloud
    template (LP: #1076031)
  * 0229-lxc-clone-mount-fix: fix wrong handling of lxc.mount entries in
    lxc-clone. (LP: #1084089)
 -- Serge Hallyn <email address hidden> Thu, 29 Nov 2012 12:45:19 -0600

Changed in lxc (Ubuntu Quantal):
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.