Package: libvirt-daemon-driver-lxc
Version: 7.0.0-3
Severity: normal

Dear Maintainer,

A Debian 11 RC2 container running on a Debian 11 RC2 hosts responds
to the reboot command by shutting down services and then powering
off, *not* by rebooting, which is what I would expect.

This applies regardless of whether I:

* run 'reboot' inside the container
* run 'virsh reboot' on the host
* run 'kill -SIGINT 1' inside the container

This is consistently reproducible.

Here's output from trying it with 'virsh reboot', as it's the
most copy-and-paste-able:

        pestaroli# export LIBVIRT_DEFAULT_URI=lxc:///
        pestaroli# virsh list --all
         Id   Name      State
        --------------------------
         -    mafalde   shut off
        
        pestaroli# virsh start mafalde
        Domain 'mafalde' started
        
        pestaroli# virsh list --all
         Id       Name      State
        -----------------------------
         467946   mafalde   running
        
        pestaroli# virsh reboot mafalde
        Domain 'mafalde' is being rebooted
        
        pestaroli# virsh list --all
         Id   Name      State
        --------------------------
         -    mafalde   shut off       <-------------- should be 'running'!
        
        pestaroli# 

I am submitting this bug report against the libvirt-daemon-driver-lxc
package because /usr/lib/libvirt/libvirt_lxc is the parent of the
container's init process:

        root      468678  0.0  0.4 355008 17096 ?        Sl   15:26   0:00 
/usr/lib/libvirt/libvirt_lxc --name mafalde --console 30 --security=apparmor 
--handshake 34 --veth vnet77
        100000    468681  0.7  0.2  99948 10008 ?        Ss   15:26   0:00  \_ 
/sbin/init
        100000    468713  0.3  0.3  31932 13016 ?        Ss   15:26   0:00      
\_ /lib/systemd/systemd-journald
        100105    468770  0.1  0.1   7952  4332 ?        Ss   15:26   0:00      
\_ /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile 
--systemd-activation --syslog-only
        
but it might well be that the bug is in another package (I think
you are more qualified to judge that than I am), so please reassign
if you think appropriate.  In case it is relevant, here are the
lxc/libvirt/systemd packages installed on the host:

        pestaroli# dpkg -l | egrep '(lxc|libvirt|systemd)'
        ii  liblxc1:amd64                        1:4.0.6-2                      
amd64        Linux Containers userspace tools (library)
        ii  libnss-systemd:amd64                 247.3-6                        
amd64        nss module providing dynamic user and group name resolution
        ii  libpam-systemd:amd64                 247.3-6                        
amd64        system and service manager - PAM module
        ii  libsystemd0:amd64                    247.3-6                        
amd64        systemd utility library
        ii  libvirt-clients                      7.0.0-3                        
amd64        Programs for the libvirt library
        ii  libvirt-daemon                       7.0.0-3                        
amd64        Virtualization daemon
        ii  libvirt-daemon-config-network        7.0.0-3                        
all          Libvirt daemon configuration files (default network)
        ii  libvirt-daemon-config-nwfilter       7.0.0-3                        
all          Libvirt daemon configuration files (default network filters)
        ii  libvirt-daemon-driver-lxc            7.0.0-3                        
amd64        Virtualization daemon LXC connection driver
        ii  libvirt-daemon-driver-qemu           7.0.0-3                        
amd64        Virtualization daemon QEMU connection driver
        ii  libvirt-daemon-system                7.0.0-3                        
amd64        Libvirt daemon configuration files
        ii  libvirt-daemon-system-systemd        7.0.0-3                        
all          Libvirt daemon configuration files (systemd)
        ii  libvirt0:amd64                       7.0.0-3                        
amd64        library for interfacing with different virtualization systems
        ii  lxc                                  1:4.0.6-2                      
amd64        Linux Containers userspace tools
        ii  lxc-templates                        3.0.4-5                        
amd64        Linux Containers userspace tools (templates)
        ii  lxcfs                                4.0.7-1                        
amd64        FUSE based filesystem for LXC
        ii  systemd                              247.3-6                        
amd64        system and service manager
        ii  systemd-container                    247.3-6                        
amd64        systemd container/nspawn tools
        ii  systemd-sysv                         247.3-6                        
amd64        system and service manager - SysV links
        pestaroli# 

and here is the container's XML:

        pestaroli# virsh dumpxml mafalde 
        <domain type='lxc'>
          <name>mafalde</name>
          <uuid>8489584a-c8f3-4dc7-a163-2b0e20eba7da</uuid>
          <memory unit='KiB'>1048576</memory>
          <currentMemory unit='KiB'>1048576</currentMemory>
          <vcpu placement='static'>1</vcpu>
          <resource>
            <partition>/machine</partition>
          </resource>
          <os>
            <type arch='x86_64'>exe</type>
            <init>/sbin/init</init>
          </os>
          <idmap>
            <uid start='0' target='100000' count='65536'/>
            <gid start='0' target='100000' count='65536'/>
          </idmap>
          <features>
            <privnet/>
          </features>
          <clock offset='utc'/>
          <on_poweroff>destroy</on_poweroff>
          <on_reboot>restart</on_reboot>
          <on_crash>destroy</on_crash>
          <devices>
            <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
            <filesystem type='mount' accessmode='mapped'>
              <source dir='/var/lib/libvirt/mountpoints/mafalde/root'/>
              <target dir='/'/>
            </filesystem>
            <interface type='bridge'>
              <mac address='00:16:3e:c4:bc:69'/>
              <source bridge='br0'/>
            </interface>
            <console type='pty'>
              <target type='lxc' port='0'/>
            </console>
          </devices>
        </domain>
        
        pestaroli# 

For comparison:

A Debian 11 RC2 container running on a Debian 10.10 host responds
to the reboot command by shutting down services and then hangs
(I waited about 10 minutes) without turning off with the last message:

        [  OK  ] Reached target Reboot.

A Debian 10.10 container running on a Debian 10.10 hosts responds
to the reboot command by shutting down services and then hangs
(I waited about 10 minutes) without turning off with the last messages:

        [  OK  ] Reached target Reboot.
        logout

If you need more info or have packages you'd like me to test, then
just let me know. 

Thanks for your support,

Alexis

PS standard '-- System Information' section of this reportbug-based
   report deleted as it pertains to the host I am submitting the 
   report from, not the host on which the bug was seen.

Reply via email to