mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
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>
This commit is contained in:
parent
a97c2b14b2
commit
50eae3f885
@ -181,6 +181,11 @@
|
|||||||
%define with_dmidecode 0%{!?_without_dmidecode:1}
|
%define with_dmidecode 0%{!?_without_dmidecode:1}
|
||||||
%endif
|
%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
|
# Force QEMU to run as non-root
|
||||||
%define qemu_user qemu
|
%define qemu_user qemu
|
||||||
%define qemu_group qemu
|
%define qemu_group qemu
|
||||||
@ -1282,7 +1287,11 @@ exit 0
|
|||||||
%post daemon
|
%post daemon
|
||||||
%libvirt_daemon_systemd_post virtlogd
|
%libvirt_daemon_systemd_post virtlogd
|
||||||
%libvirt_daemon_systemd_post virtlockdd
|
%libvirt_daemon_systemd_post virtlockdd
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post_inet virtproxyd
|
||||||
|
%else
|
||||||
%libvirt_daemon_systemd_post_inet libvirtd
|
%libvirt_daemon_systemd_post_inet libvirtd
|
||||||
|
%endif
|
||||||
|
|
||||||
%systemd_post libvirt-guests.service
|
%systemd_post libvirt-guests.service
|
||||||
|
|
||||||
@ -1292,6 +1301,7 @@ exit 0
|
|||||||
%systemd_preun libvirt-guests.service
|
%systemd_preun libvirt-guests.service
|
||||||
|
|
||||||
%libvirt_daemon_systemd_preun_inet libvirtd
|
%libvirt_daemon_systemd_preun_inet libvirtd
|
||||||
|
%libvirt_daemon_systemd_preun_inet virtproxyd
|
||||||
%libvirt_daemon_systemd_preun virtlogd
|
%libvirt_daemon_systemd_preun virtlogd
|
||||||
%libvirt_daemon_systemd_preun virtlockdd
|
%libvirt_daemon_systemd_preun virtlockdd
|
||||||
|
|
||||||
@ -1360,8 +1370,14 @@ fi
|
|||||||
%firewalld_reload
|
%firewalld_reload
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtnetworkd
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtnetworkd
|
%libvirt_daemon_schedule_restart virtnetworkd
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%libvirt_daemon_systemd_preun virtnetworkd
|
||||||
|
|
||||||
%postun daemon-driver-network
|
%postun daemon-driver-network
|
||||||
%if %{with_firewalld_zone}
|
%if %{with_firewalld_zone}
|
||||||
%firewalld_reload
|
%firewalld_reload
|
||||||
@ -1372,64 +1388,118 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%post daemon-driver-nwfilter
|
%post daemon-driver-nwfilter
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtnwfilterd
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtnwfilterd
|
%libvirt_daemon_schedule_restart virtnwfilterd
|
||||||
|
|
||||||
|
%preun daemon-driver-nwfilter
|
||||||
|
%libvirt_daemon_systemd_preun virtnwfilterd
|
||||||
|
|
||||||
%posttrans daemon-driver-nwfilter
|
%posttrans daemon-driver-nwfilter
|
||||||
%libvirt_daemon_perform_restart virtnwfilterd
|
%libvirt_daemon_perform_restart virtnwfilterd
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-nodedev
|
%post daemon-driver-nodedev
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtnodedevd
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtnodedevd
|
%libvirt_daemon_schedule_restart virtnodedevd
|
||||||
|
|
||||||
|
%preun daemon-driver-nodedev
|
||||||
|
%libvirt_daemon_systemd_preun virtnodedevd
|
||||||
|
|
||||||
%posttrans daemon-driver-nodedev
|
%posttrans daemon-driver-nodedev
|
||||||
%libvirt_daemon_perform_restart virtnodedevd
|
%libvirt_daemon_perform_restart virtnodedevd
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-interface
|
%post daemon-driver-interface
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtinterfaced
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtinterfaced
|
%libvirt_daemon_schedule_restart virtinterfaced
|
||||||
|
|
||||||
|
%preun daemon-driver-interface
|
||||||
|
%libvirt_daemon_systemd_preun virtinterfaced
|
||||||
|
|
||||||
%posttrans daemon-driver-interface
|
%posttrans daemon-driver-interface
|
||||||
%libvirt_daemon_perform_restart virtinterfaced
|
%libvirt_daemon_perform_restart virtinterfaced
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-secret
|
%post daemon-driver-secret
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtsecretd
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtsecretd
|
%libvirt_daemon_schedule_restart virtsecretd
|
||||||
|
|
||||||
|
%preun daemon-driver-secret
|
||||||
|
%libvirt_daemon_systemd_preun virtsecretd
|
||||||
|
|
||||||
%posttranstrans daemon-driver-secret
|
%posttranstrans daemon-driver-secret
|
||||||
%libvirt_daemon_perform_restart virtsecretd
|
%libvirt_daemon_perform_restart virtsecretd
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-storage
|
%post daemon-driver-storage
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtstoraged
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtstoraged
|
%libvirt_daemon_schedule_restart virtstoraged
|
||||||
|
|
||||||
|
%preun daemon-driver-storage
|
||||||
|
%libvirt_daemon_systemd_preun virtstoraged
|
||||||
|
|
||||||
%posttrans daemon-driver-storage
|
%posttrans daemon-driver-storage
|
||||||
%libvirt_daemon_perform_restart virtstoraged
|
%libvirt_daemon_perform_restart virtstoraged
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-qemu
|
%post daemon-driver-qemu
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtqemud
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtqemud
|
%libvirt_daemon_schedule_restart virtqemud
|
||||||
|
|
||||||
|
%preun daemon-driver-qemu
|
||||||
|
%libvirt_daemon_systemd_preun virtqemud
|
||||||
|
|
||||||
%posttrans daemon-driver-qemu
|
%posttrans daemon-driver-qemu
|
||||||
%libvirt_daemon_perform_restart virtqemud
|
%libvirt_daemon_perform_restart virtqemud
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-lxc
|
%post daemon-driver-lxc
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtlxcd
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtlxcd
|
%libvirt_daemon_schedule_restart virtlxcd
|
||||||
|
|
||||||
|
%preun daemon-driver-lxc
|
||||||
|
%libvirt_daemon_systemd_preun virtlxcd
|
||||||
|
|
||||||
%posttrans daemon-driver-lxc
|
%posttrans daemon-driver-lxc
|
||||||
%libvirt_daemon_perform_restart virtlxcd
|
%libvirt_daemon_perform_restart virtlxcd
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-vbox
|
%post daemon-driver-vbox
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtvboxd
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtvboxd
|
%libvirt_daemon_schedule_restart virtvboxd
|
||||||
|
|
||||||
|
%preun daemon-driver-vbox
|
||||||
|
%libvirt_daemon_systemd_preun virtvboxd
|
||||||
|
|
||||||
%posttrans daemon-driver-vbox
|
%posttrans daemon-driver-vbox
|
||||||
%libvirt_daemon_perform_restart virtvboxd
|
%libvirt_daemon_perform_restart virtvboxd
|
||||||
|
|
||||||
|
|
||||||
%post daemon-driver-libxl
|
%post daemon-driver-libxl
|
||||||
|
%if %{with_modular_daemons}
|
||||||
|
%libvirt_daemon_systemd_post virtxend
|
||||||
|
%endif
|
||||||
%libvirt_daemon_schedule_restart virtxend
|
%libvirt_daemon_schedule_restart virtxend
|
||||||
|
|
||||||
|
%preun daemon-driver-libxl
|
||||||
|
%libvirt_daemon_systemd_preun virtxend
|
||||||
|
|
||||||
%posttrans daemon-driver-libxl
|
%posttrans daemon-driver-libxl
|
||||||
%libvirt_daemon_perform_restart virtxend
|
%libvirt_daemon_perform_restart virtxend
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user