Restart containers on upgrade

Bug #753308 reported by Tamas Papp
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
High
Unassigned
Lucid
Invalid
Undecided
Unassigned
Maverick
Fix Released
High
Unassigned
Natty
Fix Released
High
Unassigned

Bug Description

=======================================================
SRU Justification:
  1. Impact: running containers are stopped and re-started when the lxc
     package is updated.
  2. How bug addressed: make dh_installinit with -r.
  3. Minimal patch:
=== modified file 'debian/rules'
--- debian/rules 2011-01-23 17:28:55 +0000
+++ debian/rules 2011-08-01 18:33:23 +0000
@@ -10,6 +10,7 @@
 DEB_CONFIGURE_EXTRA_FLAGS=--libdir=$(LIBDIR) \
      --with-rootfs-path=$(LIBDIR) \
      --enable-doc
+DEB_DH_INSTALLINIT_ARGS=-r

 binary-install/lxc::
  cp debian/lxc.overrides debian/lxc/usr/share/lintian/overrides/lxc

  4. TEST CASE:
     a. install lxc and debootstrap, and create a container:
        apt-get -y install lxc debootstrap libvirt-bin
 cat > /etc/lxc.conf << EOF
lxc.network.type=veth
lxc.network.link=virbr0
lxc.network.flags=up
EOF
 lxc-create -t lucid -f /etc/lxc.conf -n l1
     b. make the container autostart and start it
        echo "RUN=yes" >> /etc/default/lxc
 echo 'CONTAINERS="l1"' >> /etc/default/lxc
 ln -s /var/lib/lxc/l1/config /etc/lxc/l1.conf
 /etc/init.d/lxc start
     c. in another terminal, open a console:
        lxc-console -n l1
     d. re-install lxc
        dpkg -i /var/cache/apt/archives/lxc_*.deb
     Without this patch, the lxc-console will stop when the container is
     stopped. With this patch, it will continue to run.
  5. Regression potential:
     This only adds a flag to DEB_DH_INStALLINIT_ARGS and does not affect the
     lxc code itself. It should have no effect except when upgrading lxc.
=======================================================
Binary package hint: lxc

I'm just seeing the upgrading to the latest lxc package:

Preparing to replace lxc 0.7.4-0ubuntu4 (using .../lxc_0.7.4-0ubuntu5_amd64.deb) ...
 * Stopping LXC containers [ OK ]
Unpacking replacement lxc ...
Setting up lxc (0.7.4-0ubuntu5) ...
 * Starting LXC containers

I checked, it really stopped the containers.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: lxc 0.7.4-0ubuntu5
ProcVersionSignature: Ubuntu 2.6.38-8.41-server 2.6.38.2
Uname: Linux 2.6.38-8-server x86_64
Architecture: amd64
Date: Thu Apr 7 10:55:26 2011
InstallationMedia: Ubuntu-Server 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

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

Thanks for reporting this bug. Just to be sure I understand right, this is only happing for autostart containers, right?

Changed in lxc (Ubuntu):
status: New → Incomplete
importance: Undecided → High
assignee: nobody → Serge Hallyn (serge-hallyn)
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(Assuming this is for autostart containers, this can be marked 'fix released' for oneiric, and the fix should be SRUd for maverick and natty)

Revision history for this message
Tamas Papp (tompos) wrote :

It's true. Thank you.

Changed in lxc (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks, Tamas.

The method of specifying autostart containers has changed in oneiric, but it still has the same effect.

Changed in lxc (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(lucid is not affected, it doesn't have the initscript)

description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Uploaded both fixes to maverick/natty -proposed.

Changed in lxc (Ubuntu Lucid):
status: New → Invalid
Changed in lxc (Ubuntu Maverick):
status: New → Fix Committed
Changed in lxc (Ubuntu Natty):
status: New → Fix Committed
Changed in lxc (Ubuntu Maverick):
importance: Undecided → High
Changed in lxc (Ubuntu Natty):
importance: Undecided → High
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Tamas, or anyone else affected,

Accepted lxc into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Hello Tamas, or anyone else affected,

Accepted lxc into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Revision history for this message
Tamas Papp (tompos) wrote :

Sorry right now I don't use a clean natty nor maverick install.

I downgraded to 0.7.4-0ubuntu7.1, than apt-get upgrade:

$ apt-get install lxc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.38-10 linux-headers-2.6.38-10-server
Use 'apt-get autoremove' to remove them.
Recommended packages:
  libcap2-bin
The following packages will be upgraded:
  lxc
1 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Need to get 148 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ natty-proposed/universe lxc amd64 0.7.4-0ubuntu7.2 [148 kB]
Fetched 148 kB in 0s (541 kB/s)
(Reading database ... 99263 files and directories currently installed.)
Preparing to replace lxc 0.7.4-0ubuntu7.1 (using .../lxc_0.7.4-0ubuntu7.2_amd64.deb) ...
 * Stopping LXC containers [ OK ]
Unpacking replacement lxc ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up lxc (0.7.4-0ubuntu7.2) ...
 * Starting LXC containers [ OK ]
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

So it's not OK or maybe I miss something?

Changed in lxc (Ubuntu):
assignee: Serge Hallyn (serge-hallyn) → nobody
Revision history for this message
Scott Moser (smoser) wrote :

Just to be clear on status here, this is fix-released in oneiric.
It has been uploaded to archive in -proposed for maverick and natty, but we are waiting on someone to verify it before it will enter -updates.

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

Verified for both maverick and natty.

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

This bug was fixed in the package lxc - 0.7.2-1ubuntu1

---------------
lxc (0.7.2-1ubuntu1) maverick-proposed; urgency=low

  [ Serge Hallyn ]
  * debian/rules: add -r (--no-restart-on-upgrade) to DEB_DH_INSTALLINIT_ARGS
    to prevent upgrading lxc from forcing lxc autostart containers to
    stop and restart. (LP: #753308)
  * debian/control: set ubuntu maintainer.
 -- Clint Byrum <email address hidden> Mon, 12 Sep 2011 17:38:28 -0700

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

This bug was fixed in the package lxc - 0.7.4-0ubuntu7.2

---------------
lxc (0.7.4-0ubuntu7.2) natty-proposed; urgency=low

  [ Serge Hallyn ]
  * debian/rules: add -r (--no-restart-on-upgrade) to DEB_DH_INSTALLINIT_ARGS
    to prevent upgrading lxc from forcing lxc autostart containers to
    stop and restart. (LP: #753308)
 -- Clint Byrum <email address hidden> Mon, 12 Sep 2011 17:32:15 -0700

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