summaryrefslogtreecommitdiff
path: root/libvirt.spec.in
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2021-07-28 17:12:43 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2021-08-04 15:59:15 +0100
commit50eae3f8859c746aa474401b38902fa500f23fad (patch)
treea17fa7d0fef49355bc30e6784ea9c757858bb800 /libvirt.spec.in
parenta97c2b14b22f6e7ea177f43ff9e6f7a7f071a53c (diff)
downloadlibvirt-50eae3f8859c746aa474401b38902fa500f23fad.tar.gz
rpm: handle enabling/disabling modular daemons post/postun-install
We need to enable or disable the modular daemons with systemd after the RPM install/uninstall. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'libvirt.spec.in')
-rw-r--r--libvirt.spec.in70
1 files changed, 70 insertions, 0 deletions
diff --git a/libvirt.spec.in b/libvirt.spec.in
index f61509ac48..38c50bd07f 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -181,6 +181,11 @@
%define with_dmidecode 0%{!?_without_dmidecode:1}
%endif
+%define with_modular_daemons 0
+%if 0%{?fedora} >= 35 || 0%{?rhel} >= 9
+%define with_modular_daemons 1
+%endif
+
# Force QEMU to run as non-root
%define qemu_user qemu
%define qemu_group qemu
@@ -1282,7 +1287,11 @@ exit 0
%post daemon
%libvirt_daemon_systemd_post virtlogd
%libvirt_daemon_systemd_post virtlockdd
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post_inet virtproxyd
+%else
%libvirt_daemon_systemd_post_inet libvirtd
+%endif
%systemd_post libvirt-guests.service
@@ -1292,6 +1301,7 @@ exit 0
%systemd_preun libvirt-guests.service
%libvirt_daemon_systemd_preun_inet libvirtd
+%libvirt_daemon_systemd_preun_inet virtproxyd
%libvirt_daemon_systemd_preun virtlogd
%libvirt_daemon_systemd_preun virtlockdd
@@ -1360,8 +1370,14 @@ fi
%firewalld_reload
%endif
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtnetworkd
+%endif
%libvirt_daemon_schedule_restart virtnetworkd
+%preun
+%libvirt_daemon_systemd_preun virtnetworkd
+
%postun daemon-driver-network
%if %{with_firewalld_zone}
%firewalld_reload
@@ -1372,64 +1388,118 @@ fi
%post daemon-driver-nwfilter
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtnwfilterd
+%endif
%libvirt_daemon_schedule_restart virtnwfilterd
+%preun daemon-driver-nwfilter
+%libvirt_daemon_systemd_preun virtnwfilterd
+
%posttrans daemon-driver-nwfilter
%libvirt_daemon_perform_restart virtnwfilterd
%post daemon-driver-nodedev
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtnodedevd
+%endif
%libvirt_daemon_schedule_restart virtnodedevd
+%preun daemon-driver-nodedev
+%libvirt_daemon_systemd_preun virtnodedevd
+
%posttrans daemon-driver-nodedev
%libvirt_daemon_perform_restart virtnodedevd
%post daemon-driver-interface
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtinterfaced
+%endif
%libvirt_daemon_schedule_restart virtinterfaced
+%preun daemon-driver-interface
+%libvirt_daemon_systemd_preun virtinterfaced
+
%posttrans daemon-driver-interface
%libvirt_daemon_perform_restart virtinterfaced
%post daemon-driver-secret
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtsecretd
+%endif
%libvirt_daemon_schedule_restart virtsecretd
+%preun daemon-driver-secret
+%libvirt_daemon_systemd_preun virtsecretd
+
%posttranstrans daemon-driver-secret
%libvirt_daemon_perform_restart virtsecretd
%post daemon-driver-storage
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtstoraged
+%endif
%libvirt_daemon_schedule_restart virtstoraged
+%preun daemon-driver-storage
+%libvirt_daemon_systemd_preun virtstoraged
+
%posttrans daemon-driver-storage
%libvirt_daemon_perform_restart virtstoraged
%post daemon-driver-qemu
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtqemud
+%endif
%libvirt_daemon_schedule_restart virtqemud
+%preun daemon-driver-qemu
+%libvirt_daemon_systemd_preun virtqemud
+
%posttrans daemon-driver-qemu
%libvirt_daemon_perform_restart virtqemud
%post daemon-driver-lxc
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtlxcd
+%endif
%libvirt_daemon_schedule_restart virtlxcd
+%preun daemon-driver-lxc
+%libvirt_daemon_systemd_preun virtlxcd
+
%posttrans daemon-driver-lxc
%libvirt_daemon_perform_restart virtlxcd
%post daemon-driver-vbox
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtvboxd
+%endif
%libvirt_daemon_schedule_restart virtvboxd
+%preun daemon-driver-vbox
+%libvirt_daemon_systemd_preun virtvboxd
+
%posttrans daemon-driver-vbox
%libvirt_daemon_perform_restart virtvboxd
%post daemon-driver-libxl
+%if %{with_modular_daemons}
+%libvirt_daemon_systemd_post virtxend
+%endif
%libvirt_daemon_schedule_restart virtxend
+%preun daemon-driver-libxl
+%libvirt_daemon_systemd_preun virtxend
+
%posttrans daemon-driver-libxl
%libvirt_daemon_perform_restart virtxend