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.
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.
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: /gitlab. com/libvirt/ libvirt/ -/commit/ bab464f8ea54d17 7e163f32c7c3476 220694665c /gitlab. com/libvirt/ libvirt/ -/commit/ ee16a195d97315b a3610b3640d347d 3f4a358b55 /bugzilla. redhat. com/show_ bug.cgi? id=1755303
- https:/
- https:/
- https:/
So only the "very first" start after boot counts for auto-start.
This can be verified to be the reason: admin.socket ro.socket libvirt/ network/ autostarted ------- ------- ------- ------- ------- --
ubuntu@k:~$ sudo systemctl stop libvirtd
Warning: Stopping libvirtd.service, but it can still be activated by:
libvirtd.socket
libvirtd-
libvirtd-
ubuntu@k:~$ sudo rm /var/run/
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). magic+set- autostart on initial install. On upgrades we keep whatever was there anyway.
Conceptually that is ok for what we need from the postinst, we only do the network-
So the move of the code in the postinst should be enough to fix this.