closing libvirt-lxc console kills container

Bug #668369 reported by Serge Hallyn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Steps to reproduce: create a libvirt-lxc container and log in. When you
log out, the container dies.

Expected results: the container stays up and the console offers a new login
prompt.

(See
http://s3hh.wordpress.com/2010/09/07/easier-creation-of-libvirt-lxc-containers/
for easy creation of container with a console login to test with)

Tags: patch
Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 668369] [NEW] closing libvirt-lxc console kills container

My best guess (without actually looking at code at all) is that due to
the console fd closing, libvirt thinks the domain has died or crashed or
something and then it reaps it.

Mathias Gug (mathiaz)
Changed in libvirt (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
Changed in libvirt (Ubuntu):
status: New → In Progress
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Alas, the natty package did not fix the bug for me:

===================================================================
root@sergelap:/home/serge/libvirt-lxc-console# virsh -c lxc:/// start apache1
Domain apache1 started

root@sergelap:/home/serge/libvirt-lxc-console# virsh -c lxc:/// console apache1
Connected to domain apache1
Escape character is ^]
init: ssh main process (21) terminated with status 255

Ubuntu 10.04 LTS sergelap pts/0

sergelap login: root
Password:
Last login: Sat Feb 19 03:31:51 UTC 2011 on pts/0
Linux sergelap 2.6.37-12-generic #26-Ubuntu SMP Wed Jan 5 18:35:17 UTC 2011 x86_64 GNU/Linux
Ubuntu 10.04 LTS

Welcome to Ubuntu!
 * Documentation: https://help.ubuntu.com/
-bash: no job control in this shell
root@sergelap:~#
root@sergelap:/home/serge/libvirt-lxc-console# virsh -c lxc:/// console apache1
error: The domain is not running

Changed in libvirt (Ubuntu):
status: In Progress → Confirmed
tags: added: patch
Revision history for this message
Chuck Short (zulcss) wrote :

Serge,

Anything in the log files when this happened?

chuck

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

Only the usual:

14:45:25.333: error : lxcFdForward:263 : read of fd 7 failed: Input/output error

Fortunately Daniel Berrange just sent a patch upstream for this bug. I've extracted the core of what we need, and added it to the tree linked to this bug. The package I built worked!

The complete patch from Daniel will go into the 0.8.7 merge. Then the smaller patch which is in the linked tree here can go into lucid and maverick for SRU.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (9.7 KiB)

This bug was fixed in the package libvirt - 0.8.8-1ubuntu1

---------------
libvirt (0.8.8-1ubuntu1) natty; urgency=low

  * Resynchronize and merge from Debian unstable. Remaining changes:
    - debian/patches:
      * 9000-delayed_iff_up_bridge.patch
      * 9001-dont_clobber_existing_bridges.patch
      * 9002-better_default_uri_virsh.patch
      * 9003-better-default-arch.patch
      * 9004-libvirtd-group-name.patch
      * 9005-increase-unix-socket-timeout.patch
      * 9006-default-config-test-case.patch
      * 9007-fix-daemon-conf-ftbfs.patch
      * 9011-move-ebtables-script.patch
      * 9014-skip-nodeinfotest.patch
      * 9020-lp545795.patch
      * 9021-fix-uint64_t.patch
    - debian/patches/series:
      * Disable qemu-disable-network.diff.patch
    - debian/control:
      * set ubuntu maintainer
      * Build-Depends:
        - swap libxen to libxen3, qemu to qemu-kvm, and open-iscsi to
          open-iscsi-utils in Build-Depends
        - remove virtualbox Build-Depends
        - add libxml2 and libapparmor-dev Build-Depends
      * convert Vcs-Git to Xs-Debian-Vcs-Git
      * libvirt-bin Depends: move netcat-openbsd, bridge-utils, dnsmasq-base
        (>= 2.46-1), and iptables from Recommends to Depends
      * libvirt-bin Recommends: move qemu to Suggests
      * libvirt-bin Suggests: add apparmor
      * libvirt0 Recommands: move lvm2 to Suggests
    - keep debian/libvirt-bin.apport
    - keep debian/libvirt-bin.cron.daily
    - debian/libvirt-bin.dirs:
      * add apparmor, cron.daily, and apport dirs
    - debian/libvirt-bin.examples:
      * add debian/libvirt-suspendonreboot
    - debian/libvirt-bin.install:
      * add /etc/apparmor.d files
      * add apport hook
    - debian/libvirt-bin.manpages:
      * add debian/libvirt-migrate-qemu-disks.1
    - debian/libvirt-bin.postinst:
      * replace libvirt groupname with libvirtd
      * add each admin user to libvirtd group
      * call apparmor_parser on usr.sbin.libvirtd and
        usr.lib.libvirt.virt-aa-helper
      * call 'libvirt-migrate-qemu-disks -a' after
        libvirt-bin has started if migrating from
        older than 0.8.3-1ubuntu1
    - debian/libvirt-bin.postrm:
      * replace libvirt groupname with libvirtd
      * remove usr.sbin.libvirtd and
        usr.lib.libvirt.virt-aa-helper
    - keep added files under debian/:
      * libvirt-bin.upstart
      * libvirt-migrate-qemu-disks
      * libvirt-migrate-qemu-disks.1
      * libvirt-suspendonreboot
      * apparmor profiles
    - debian/README.Debian:
      * add 'Apparmor Profile' section
      * add 'Disk migration' section
    - debian/rules:
      * don't build with vbox since virtualbox-ose is in universe
      * add --with-apparmor to DEB_CONFIGURE_EXTRA_FLAGS
      * set DEB_DH_INSTALLINIT_ARGS to '--upstart-only'
      * set DEB_MAKE_CHECK_TARGET to 'check'
      * remove unneeded binary-install/libvirt-bin:: and clean::
        sections (they only deal with sysvinit stuff)
      * add build/libvirt-bin:: section to install
        - apparmor files
        - apport hooks
        - libvirt-migrate-qemu-disks
  * The following Ubuntu packaging changes occurred during the divergence
    between ...

Read more...

Changed in libvirt (Ubuntu):
status: Confirmed → 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.