Comment 5 for bug 1990853

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

But there seems to be something else, even when libvirtd is restarted.

It recognizes that it is configured as autostart
 Name State Autostart Persistent
----------------------------------------------
 default inactive no yes

after restart then

 Name State Autostart Persistent
----------------------------------------------
 default inactive yes yes

So is it not activating it despite autostart ... hmm.

To be clear - a start works fine, no issue with it:

$ virsh net-start default
Network default started

But why not automatically ...?

On a system boot the network is correctly auto-started.

That behavior might be related to:
- https://gitlab.com/libvirt/libvirt/-/commit/bab464f8ea54d177e163f32c7c3476220694665c
- https://gitlab.com/libvirt/libvirt/-/commit/ee16a195d97315ba3610b3640d347d3f4a358b55
- https://bugzilla.redhat.com/show_bug.cgi?id=1755303

So only the "very first" start after boot counts for auto-start.

This can be verified to be the reason:
ubuntu@k:~$ sudo systemctl stop libvirtd
Warning: Stopping libvirtd.service, but it can still be activated by:
  libvirtd.socket
  libvirtd-admin.socket
  libvirtd-ro.socket
ubuntu@k:~$ sudo rm /var/run/libvirt/network/autostarted
ubuntu@k:~$ sudo systemctl start libvirtd
ubuntu@k:~$ virsh net-list --all
 Name State Autostart Persistent
--------------------------------------------
 default active yes yes

So it does start correctly on the first invocation (after boot).
Conceptually that is ok for what we need from the postinst, we only do the network-magic+set-autostart on initial install. On upgrades we keep whatever was there anyway.

So the move of the code in the postinst should be enough to fix this.