在 Ubunti 18.04 中启动 libvirt 守护进程时出现问题

在 Ubunti 18.04 中启动 libvirt 守护进程时出现问题

我正在尝试运行virt-manager以连接到 Xen。但是无法启动 libvirt 守护进程。

启动时/usr/sbn/libvirtd通过systemctl start libvirtd/usr/sbin/libvirtd通过 cmdline 启动我收到错误:

libvirtd[4289]: libvirtd: libxl_fork.c:353: sigchld_installhandler_core: \
Assertion `((void)"application must negotiate with libxl about SIGCHLD", \
!(sigchld_saved_action.sa_flags & SA_SIGINFO) && \ 
(sigchld_saved_action.sa_handler == SIG_DFL || \ 
sigchld_saved_action.sa_handler == SIG_IGN))' failed.

有什么提示可能是什么问题吗?

我正在运行通过 安装的 Xen apt-get install xen-hypervisor-4.9-amd64

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic

/usr/sbin/libvirtd 来自:

$dpkg -l | grep libvirt-daemon
ii  libvirt-daemon                             4.0.0-1ubuntu8.3                            amd64        Virtualization daemon
ii  libvirt-daemon-driver-storage-rbd          4.0.0-1ubuntu8.3                            amd64        Virtualization daemon RBD storage driver
ii  libvirt-daemon-system                      4.0.0-1ubuntu8.3                            amd64        Libvirt daemon configuration files

Xen 运行情况为:

$xl info
host                   : testpc
release                : 4.15.0-23-generic
version                : #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018
machine                : x86_64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 4
threads_per_core       : 2
cpu_mhz                : 4018
hw_caps                : 178bf3ff:b698320b:2e500800:0069bfff:00000000:00000008:00000000:00000500
virt_caps              : hvm hvm_directio
total_memory           : 24533
free_memory            : 177
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 9
xen_extra              : .2
xen_version            : 4.9.2
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : 
xen_commandline        : placeholder no-real-mode edd=off
cc_compiler            : gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
cc_compile_by          : stefan.bader
cc_compile_domain      : canonical.com
cc_compile_date        : Mon Apr 16 09:42:18 UTC 2018
build_id               : 4f93092557432bea3ef725e146dc7ad9e334ba8b
xend_config_format     : 4

存在大量依赖性:

ldd /usr/sbin/libvirtd 
    linux-vdso.so.1 (0x00007ffc94543000)
    libvirt-admin.so.0 => /usr/lib/x86_64-linux-gnu/libvirt-admin.so.0 (0x00007faf559b0000)
    libvirt.so.0 => /usr/lib/x86_64-linux-gnu/libvirt.so.0 (0x00007faf553d8000)
    libvirt-lxc.so.0 => /usr/lib/x86_64-linux-gnu/libvirt-lxc.so.0 (0x00007faf551d0000)
    libvirt-qemu.so.0 => /usr/lib/x86_64-linux-gnu/libvirt-qemu.so.0 (0x00007faf54fc8000)
    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007faf54d78000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007faf54b58000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007faf54760000)
    libcap-ng.so.0 => /lib/x86_64-linux-gnu/libcap-ng.so.0 (0x00007faf54558000)
    libyajl.so.2 => /usr/lib/x86_64-linux-gnu/libyajl.so.2 (0x00007faf54348000)
    libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200 (0x00007faf54128000)
    libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007faf53ef8000)
    libdevmapper.so.1.02.1 => /lib/x86_64-linux-gnu/libdevmapper.so.1.02.1 (0x00007faf53c88000)
    libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007faf53a78000)
    libacl.so.1 => /lib/x86_64-linux-gnu/libacl.so.1 (0x00007faf53870000)
    libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007faf534a8000)
    libavahi-common.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007faf53298000)
    libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007faf53080000)
    libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007faf52d18000)
    libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007faf52af8000)
    libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007faf52878000)
    libapparmor.so.1 => /lib/x86_64-linux-gnu/libapparmor.so.1 (0x00007faf52668000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007faf52460000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007faf52258000)
    libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007faf51fd0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007faf55e58000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007faf51c30000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007faf51a08000)
    libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007faf517e8000)
    libattr.so.1 => /lib/x86_64-linux-gnu/libattr.so.1 (0x00007faf515e0000)
    libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007faf51228000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007faf51008000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007faf50de0000)
    libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007faf50ab0000)
    libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007faf50890000)
    libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007faf50510000)
    libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007faf502f8000)
    libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007faf500c0000)
    libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007faf4fe88000)
    libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007faf4fc00000)
    libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007faf4f9d8000)
    librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007faf4f7b8000)
    libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007faf4f5a8000)
    libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007faf4f358000)
    libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007faf4f100000)
    liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007faf4eef0000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007faf4ece8000)
    liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007faf4eac8000)
    libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007faf4e7a8000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007faf4e530000)
    libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007faf4c980000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007faf4c5f0000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007faf4c3d8000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007faf4c1d0000)
    libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007faf4bef8000)
    libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007faf4bcc0000)
    libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007faf4bab8000)
    libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007faf4b8a8000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007faf4b688000)
    libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007faf4b440000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007faf4b228000)
    libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007faf4b020000)
    libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007faf4ae10000)
    libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007faf4ab80000)
    libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007faf4a8d8000)
    libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007faf4a6a0000)
    libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007faf4a488000)
    libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007faf4a258000)
    libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007faf4a048000)
    libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007faf49df8000)
    libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007faf49ae8000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007faf498b0000)

回溯:

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fa274e80801 in __GI_abort () at abort.c:79
#2  0x00007fa274e7039a in __assert_fail_base (fmt=0x7fa274ff77d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7fa23b297630 "((void)\"application must negotiate with libxl about SIGCHLD\", !(sigchld_saved_action.sa_flags & SA_SIGINFO) && (sigchld_saved_action.sa_handler == SIG_DFL || sigchld_saved_action.sa_handler == SIG_IGN"..., file=file@entry=0x7fa23b297436 "libxl_fork.c", 
    line=line@entry=353, function=function@entry=0x7fa23b297850 "sigchld_installhandler_core") at assert.c:92
#3  0x00007fa274e70412 in __GI___assert_fail (
    assertion=0x7fa23b297630 "((void)\"application must negotiate with libxl about SIGCHLD\", !(sigchld_saved_action.sa_flags & SA_SIGINFO) && (sigchld_saved_action.sa_handler == SIG_DFL || sigchld_saved_action.sa_handler == SIG_IGN"..., file=0x7fa23b297436 "libxl_fork.c", line=353, 
    function=0x7fa23b297850 "sigchld_installhandler_core") at assert.c:101
#4  0x00007fa23b253ac0 in libxl.sigchld_needed () from /usr/lib/x86_64-linux-gnu/libxenlight-4.9.so
#5  0x00007fa23b253ece in libxl_childproc_setmode () from /usr/lib/x86_64-linux-gnu/libxenlight-4.9.so
#6  0x00007fa23b4e4f35 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_libxl.so
#7  0x00007fa275c4bdb5 in virStateInitialize () from /usr/lib/x86_64-linux-gnu/libvirt.so.0
#8  0x0000562b443bebeb in ?? ()
#9  0x00007fa275ba1ad2 in ?? () from /usr/lib/x86_64-linux-gnu/libvirt.so.0
#10 0x00007fa27523f6db in start_thread (arg=0x7fa213fff700) at pthread_create.c:463
#11 0x00007fa274f6188f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

答案1

我进一步调试,发现该断言来自:

(gdb) p /x sigchld_saved_action
$3 = {__sigaction_handler = {sa_handler = 0x7fc5b5b1c400, sa_sigaction = 0x7fc5b5b1c400}, sa_mask = {__val = {0x0, 0xb, 0x7fc5ff51209d, 0x7fc5ff7308f0, 
      0xb, 0x1d, 0x5, 0x7fc5c5044ca0, 0x7fc594123d00, 0x7fc5c50448d0, 0x7fc5ff5120be, 0x7fc5ff774760, 0x557e03daa170, 0x7fc5b1eae730, 0x7fc594123d00, 
      0x7fc5b1eae680}}, sa_flags = 0x14000001, sa_restorer = 0x7fc5fec12890}

sigchld_saved_action.sa_handler里面似乎有一个处理程序

7fc5b5c1f000-7fc5b5e1f000 ---p 002a7000 08:12 1578012                    /usr/lib/virtualbox/VBoxRT.so

它来自 /usr/lib/virtualbox/VBoxRT.so。

移走 /usr/lib/virtualbox sudo mv /usr/lib/virtualbox /usr/lib/virtualbox.bck 使我能够启动libvirtd

相关内容