<div dir="ltr"><div>Package: libvirt</div><div>Version: 4.6.0-1</div><div>Severity: normal</div><div><br></div><div>Hi,</div><div>I ran into this while testing libvirt 4.6 and opened initially just Ubuntu bug [1].</div><div>But I found nothing Ubuntu-special so I recreated on Debian and realized that you are affected as well.</div><div><br></div><div>I have no solution yet, but would be happy if we can sync on ideas and implement the same eventually whatever we come up with.</div><div>But first let me outline the issue</div><div><br></div><div>TL;DR:</div><div>- virtlogd.service has since 4.2 a requires statement to both sockets (virtlods.socket and virtlogd-admin.socket)</div><div>- before an upgrade usually virtlogd.socket and virtlogd.service are running</div><div>- on the upgrade virtlogd-admin.socket gets installed</div><div>Note: all those services/sockets run with no-restart-on-upgrade<br></div><div>- virtlogd should not be restarted, so it calls systemctl reload</div><div>- dh_systemd_enable: the two sockets files get enabled</div>- dh_systemd_start: will only call deb-systemd-invoke start on the sockets ignoring errors<div>- /etc/init.d/virtlogd exists, so the postinst calls "invoke-rc.d virtlogd start"</div><div><br></div><div>Remember that virtlogd is already running and working fine.<br></div><div>But that last step makes it realize that the new requires dependency to virtlogd-admin.socket is not fulfilled and aborts the installation.<br><div><br></div><div>In a similar fashion /etc/init.d/libvirtd always gives an extra potentially fatal "start" action.</div><div>Since the latter is not instaklled with no-restart dh_installinit will even make this a restart call on upgrades.</div><div><br></div>As a POC I took away:<br>  $ mv  /etc/init.d/virtlogd /etc/init.d/virtlogd.nothere<br>But then realized we still start libvirtd through "invoke-rc.d libvirtd $_dh_action" which due to this line in the init script:<br>  # Required-Start:    $network $local_fs $remote_fs $syslog virtlogd<br>will fail to start now.</div><div>Overall this is preferred by dh_systemd_start since both scripts are installed.</div><div><br></div><div>I think it might be time to drop both sysV scripts as it seems that would resolve all of it by eliminating the double calls.</div><div>But I need to test that without messing in a container, but a real package build to be sure.<br><div><br></div><div>Details of such an upgrade - example is stable 3.0 -> testing 4.5</div><div><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">PRE<br>root@debian-stretch:~# systemctl status virtlogd.service virtlogd.socket virtlogd-admin.socket virtlockd.service virtlockd.socket virtlockd-admin.socket --no-pager --lines 2<br>● virtlogd.service - Virtual machine log manager<br>   Loaded: loaded (/lib/systemd/system/virtlogd.service; indirect; vendor preset: enabled)<br>   Active: active (running) since Thu 2018-08-09 09:28:33 UTC; 7s ago<br>     Docs: man:virtlogd(8)<br>           <a rel="nofollow" href="http://libvirt.org/" style="color:rgb(0,51,170);text-decoration-line:none">http://libvirt.org</a><br> Main PID: 7080 (virtlogd)<br>    Tasks: 2 (limit: 4915)<br>   CGroup: /system.slice/virtlogd.service<br>           └─7080 /usr/sbin/virtlogd</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:28:35 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:28:37 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlogd.socket - Virtual machine log manager socket<br>   Loaded: loaded (/lib/systemd/system/virtlogd.socket; enabled; vendor preset: enabled)<br>   Active: active (running) since Thu 2018-08-09 09:28:33 UTC; 7s ago<br>   Listen: /var/run/libvirt/virtlogd-sock (Stream)</p><p id="gmail-yui_3_10_3_1_1533802982995_1933" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:28:33 debian-stretch systemd[1]: Listening on Virtual machine log manager socket.<br>Unit virtlogd-admin.socket could not be found.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlockd.service - Virtual machine lock manager<br>   Loaded: loaded (/lib/systemd/system/virtlockd.service; indirect; vendor preset: enabled)<br>   Active: inactive (dead)<br>     Docs: man:virtlockd(8)<br>           <a rel="nofollow" href="http://libvirt.org/" style="color:rgb(0,51,170);text-decoration-line:none">http://libvirt.org</a></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlockd.socket - Virtual machine lock manager socket<br>   Loaded: loaded (/lib/systemd/system/virtlockd.socket; enabled; vendor preset: enabled)<br>   Active: active (listening) since Thu 2018-08-09 09:28:34 UTC; 7s ago<br>   Listen: /var/run/libvirt/virtlockd-sock (Stream)</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:28:34 debian-stretch systemd[1]: Listening on Virtual machine lock manager socket.<br>Unit virtlockd-admin.socket could not be found.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Upgrade just libvirt and dependencies - stretch to testing.<br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"># apt install libvirt-daemon-system<br>Reading package lists... Done<br>Building dependency tree<br>Reading state information... Done<br>The following packages were automatically installed and are no longer required:<br>  libboost-iostreams1.62.0 libboost-random1.62.0 libboost-system1.62.0 libboost-thread1.62.0 librados2 librbd1<br>Use 'apt autoremove' to remove them.<br>The following additional packages will be installed:<br>  ca-certificates libcap-ng0 libcom-err2 libcomerr2 libcurl3-gnutls libidn2-0 libnghttp2-14 libpsl5 librtmp1 libunistring2 libvirt-clients<br>  libvirt-daemon libvirt0 openssl publicsuffix<br>Suggested packages:<br>  libvirt-daemon-driver-storage-gluster libvirt-daemon-driver-storage-rbd libvirt-daemon-driver-storage-sheepdog<br>  libvirt-daemon-driver-storage-zfs numad apparmor auditd nfs-common open-iscsi pm-utils radvd systemtap zfsutils<br>The following NEW packages will be installed:<br>  ca-certificates libcom-err2 libcurl3-gnutls libidn2-0 libnghttp2-14 libpsl5 librtmp1 libunistring2 openssl publicsuffix<br>The following packages will be upgraded:<br>  libcap-ng0 libcomerr2 libvirt-clients libvirt-daemon libvirt-daemon-system libvirt0<br>6 upgraded, 10 newly installed, 0 to remove and 248 not upgraded.<br>Need to get 9437 kB of archives.<br>After this operation, 5147 kB of additional disk space will be used.<br>Do you want to continue? [Y/n] Y<br>[...]<br>Setting up libvirt-daemon-system (4.5.0-1) ...<br>Installing new version of config file /etc/apparmor.d/abstractions/libvirt-qemu ...<br>Installing new version of config file /etc/apparmor.d/libvirt/TEMPLATE.lxc ...<br>Installing new version of config file /etc/apparmor.d/libvirt/TEMPLATE.qemu ...<br>Installing new version of config file /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper ...<br>Installing new version of config file /etc/apparmor.d/usr.sbin.libvirtd ...<br>Installing new version of config file /etc/default/libvirt-guests ...<br>Installing new version of config file /etc/init.d/libvirt-guests ...<br>Installing new version of config file /etc/libvirt/libvirtd.conf ...<br>Installing new version of config file /etc/libvirt/libxl.conf ...<br>Installing new version of config file /etc/libvirt/qemu.conf ...<br>Installing new version of config file /etc/libvirt/virtlockd.conf ...<br>Installing new version of config file /etc/libvirt/virtlogd.conf ...<br>Installing new version of config file /etc/logrotate.d/libvirtd.libxl ...<br>Installing new version of config file /etc/logrotate.d/libvirtd.lxc ...<br>Installing new version of config file /etc/logrotate.d/libvirtd.qemu ...<br>Installing new version of config file /etc/logrotate.d/libvirtd.uml ...<br>Installing new version of config file /etc/sasl2/libvirt.conf ...<br>Created symlink /etc/systemd/system/sockets.target.wants/virtlockd-admin.socket → /lib/systemd/system/virtlockd-admin.socket.<br>Created symlink /etc/systemd/system/sockets.target.wants/virtlogd-admin.socket → /lib/systemd/system/virtlogd-admin.socket.<br>virtlockd.service is a disabled or a static unit, not starting it.<br>Job for virtlogd-admin.socket failed.<br>See "systemctl status virtlogd-admin.socket" and "journalctl -xe" for details.<br>virtlogd-admin.socket couldn't start.<br>A dependency job for virtlogd.service failed. See 'journalctl -xe' for details.<br>invoke-rc.d: initscript virtlogd, action "start" failed.<br>● virtlogd.service - Virtual machine log manager<br>   Loaded: loaded (/lib/systemd/system/virtlogd.service; indirect; vendor preset: enabled)<br>   Active: active (running) since Thu 2018-08-09 09:35:36 UTC; 50s ago<br>     Docs: man:virtlogd(8)<br>           <a rel="nofollow" href="https://libvirt.org/" style="color:rgb(0,51,170);text-decoration-line:none">https://libvirt.org</a><br> Main PID: 6774 (virtlogd)<br>   CGroup: /system.slice/virtlogd.service<br>           └─6774 /usr/sbin/virtlogd</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:35:38 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:35:41 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:36:21 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:36:25 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:36:25 debian-stretch systemd[1]: Reloading Virtual machine log manager.<br>Aug 09 09:36:25 debian-stretch systemd[1]: Reloaded Virtual machine log manager.<br>Aug 09 09:36:26 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:36:26 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted<br>Aug 09 09:36:27 debian-stretch systemd[1]: Dependency failed for Virtual machine log manager.<br>Aug 09 09:36:27 debian-stretch systemd[1]: virtlogd.service: Job virtlogd.service/start failed with result 'dependency'.<br>dpkg: error processing package libvirt-daemon-system (--configure):<br> subprocess installed post-installation script returned error exit status 1<br>Processing triggers for ca-certificates (20170717) ...<br>Updating certificates in /etc/ssl/certs...<br>0 added, 0 removed; done.<br>Running hooks in /etc/ca-certificates/update.d...<br>done.<br>Processing triggers for libc-bin (2.24-11+deb9u3) ...<br>Processing triggers for systemd (232-25+deb9u4) ...<br>Errors were encountered while processing:<br> libvirt-daemon-system<br>E: Sub-process /usr/bin/dpkg returned an error code (1)</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Status after install:</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"># systemctl status virtlogd.service virtlogd.socket virtlogd-admin.socket virtlockd.service virtlockd.socket virtlockd-admin.socket --no-pager --lines 2<br>● virtlogd.service - Virtual machine log manager<br>   Loaded: loaded (/lib/systemd/system/virtlogd.service; indirect; vendor preset: enabled)<br>   Active: active (running) since Thu 2018-08-09 09:35:36 UTC; 1min 11s ago<br>     Docs: man:virtlogd(8)<br>           <a rel="nofollow" href="https://libvirt.org/" style="color:rgb(0,51,170);text-decoration-line:none">https://libvirt.org</a><br> Main PID: 6774 (virtlogd)<br>    Tasks: 2 (limit: 4915)<br>   CGroup: /system.slice/virtlogd.service<br>           └─6774 /usr/sbin/virtlogd</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:36:27 debian-stretch systemd[1]: virtlogd.service: Job virtlogd.service/start failed with result 'dependency'.<br>Aug 09 09:36:31 debian-stretch systemd[1]: virtlogd.service: Failed to reset devices.list: Operation not permitted</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlogd.socket - Virtual machine log manager socket<br>   Loaded: loaded (/lib/systemd/system/virtlogd.socket; enabled; vendor preset: enabled)<br>   Active: active (running) since Thu 2018-08-09 09:35:36 UTC; 1min 11s ago<br>   Listen: /var/run/libvirt/virtlogd-sock (Stream)</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:35:36 debian-stretch systemd[1]: Listening on Virtual machine log manager socket.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlogd-admin.socket - Virtual machine log manager socket<br>   Loaded: loaded (/lib/systemd/system/virtlogd-admin.socket; enabled; vendor preset: enabled)<br>   Active: inactive (dead)<br>   Listen: /var/run/libvirt/virtlogd-admin-sock (Stream)</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:36:27 debian-stretch systemd[1]: virtlogd-admin.socket: Socket service virtlogd.service already active, refusing.<br>Aug 09 09:36:27 debian-stretch systemd[1]: Failed to listen on Virtual machine log manager socket.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlockd.service - Virtual machine lock manager<br>   Loaded: loaded (/lib/systemd/system/virtlockd.service; indirect; vendor preset: enabled)<br>   Active: inactive (dead)<br>     Docs: man:virtlockd(8)<br>           <a rel="nofollow" href="https://libvirt.org/" style="color:rgb(0,51,170);text-decoration-line:none">https://libvirt.org</a></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlockd.socket - Virtual machine lock manager socket<br>   Loaded: loaded (/lib/systemd/system/virtlockd.socket; enabled; vendor preset: enabled)<br>   Active: active (listening) since Thu 2018-08-09 09:36:26 UTC; 21s ago<br>   Listen: /var/run/libvirt/virtlockd-sock (Stream)</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:36:26 debian-stretch systemd[1]: Stopping Virtual machine lock manager socket.<br>Aug 09 09:36:26 debian-stretch systemd[1]: Listening on Virtual machine lock manager socket.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">● virtlockd-admin.socket - Virtual machine lock manager admin socket<br>   Loaded: loaded (/lib/systemd/system/virtlockd-admin.socket; enabled; vendor preset: enabled)<br>   Active: active (listening) since Thu 2018-08-09 09:36:26 UTC; 21s ago<br>   Listen: /var/run/libvirt/virtlockd-admin-sock (Stream)</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Aug 09 09:36:26 debian-stretch systemd[1]: Listening on Virtual machine lock manager admin socket.</p></div><div><br></div><div>[1]: <a href="https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1786179">https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1786179</a></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div></div></div>