From 4df52fea7e3a00d6ad7eb3fc4ed3b7b06beacade Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 16 Apr 2015 15:42:05 -0400 Subject: [PATCH] spec: If installing default network, restart libvirtd If libvirt-daemon-config-network is installed while libvirtd is already running, the daemon doesn't notice the network. Users then have to manually restart libvirtd (or reboot) to pick up the network. Instead let's trigger a daemon restart when the package is first installed. Then the default network is available immediately if libvirtd was already running. https://bugzilla.redhat.com/show_bug.cgi?id=867546 (cherry picked from commit 1d4400082a02c41b152cc9ab7b4cfc428cc527ee) --- libvirt.spec.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5b78ed7216..0153c4f820 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1799,6 +1799,14 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; < %{_datadir}/libvirt/networks/default.xml \ > %{_sysconfdir}/libvirt/qemu/networks/default.xml ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml + + # Make sure libvirt picks up the new network defininiton + %if %{with_systemd} + /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||: + %else + /sbin/service libvirtd condrestart > /dev/null 2>&1 || : + %endif + fi %endif -- 2.47.2