rpm: Reduce use of with_modular_daemons

The current implementation pretty much assumes that targets
where modular daemons are the default will stick with that
configuration, as will targets where they're not, or that
changes to these defaults will be performed by the admin after
the packages have been installed.

This is unnecessarily limiting: for example, on a target that
defaults to using the monolithic daemon, it's entirely possible
to create a local preset such as

  # /etc/systemd/system-preset/00-virt.preset
  disable libvirtd.service
  disable libvirtd*.socket
  enable virtqemud.service

to opt into a modular daemon deployment. The opposite is of
course also true. We shouldn't get in the way of these
reasonable use cases.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-07-03 18:41:18 +02:00
parent 1f3065a552
commit ea45933d35

View File

@ -1487,9 +1487,7 @@ fi \
%libvirt_sysconfig_pre libvirtd %libvirt_sysconfig_pre libvirtd
%post daemon %post daemon
%if ! %{with_modular_daemons}
%libvirt_daemon_systemd_post_inet libvirtd %libvirt_daemon_systemd_post_inet libvirtd
%endif
%libvirt_daemon_schedule_restart libvirtd %libvirt_daemon_schedule_restart libvirtd
%posttrans daemon %posttrans daemon
@ -1591,9 +1589,7 @@ fi
%libvirt_sysconfig_pre virtproxyd %libvirt_sysconfig_pre virtproxyd
%post daemon-proxy %post daemon-proxy
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post_inet virtproxyd %libvirt_daemon_systemd_post_inet virtproxyd
%endif
%posttrans daemon-proxy %posttrans daemon-proxy
%libvirt_sysconfig_posttrans virtproxyd %libvirt_sysconfig_posttrans virtproxyd
@ -1609,9 +1605,7 @@ fi
%firewalld_reload %firewalld_reload
%endif %endif
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtnetworkd %libvirt_daemon_systemd_post virtnetworkd
%endif
%libvirt_daemon_schedule_restart virtnetworkd %libvirt_daemon_schedule_restart virtnetworkd
%posttrans daemon-driver-network %posttrans daemon-driver-network
@ -1630,9 +1624,7 @@ fi
%libvirt_sysconfig_pre virtnwfilterd %libvirt_sysconfig_pre virtnwfilterd
%post daemon-driver-nwfilter %post daemon-driver-nwfilter
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtnwfilterd %libvirt_daemon_systemd_post virtnwfilterd
%endif
%libvirt_daemon_schedule_restart virtnwfilterd %libvirt_daemon_schedule_restart virtnwfilterd
%posttrans daemon-driver-nwfilter %posttrans daemon-driver-nwfilter
@ -1646,9 +1638,7 @@ fi
%libvirt_sysconfig_pre virtnodedevd %libvirt_sysconfig_pre virtnodedevd
%post daemon-driver-nodedev %post daemon-driver-nodedev
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtnodedevd %libvirt_daemon_systemd_post virtnodedevd
%endif
%libvirt_daemon_schedule_restart virtnodedevd %libvirt_daemon_schedule_restart virtnodedevd
%posttrans daemon-driver-nodedev %posttrans daemon-driver-nodedev
@ -1662,9 +1652,7 @@ fi
%libvirt_sysconfig_pre virtinterfaced %libvirt_sysconfig_pre virtinterfaced
%post daemon-driver-interface %post daemon-driver-interface
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtinterfaced %libvirt_daemon_systemd_post virtinterfaced
%endif
%libvirt_daemon_schedule_restart virtinterfaced %libvirt_daemon_schedule_restart virtinterfaced
%posttrans daemon-driver-interface %posttrans daemon-driver-interface
@ -1678,9 +1666,7 @@ fi
%libvirt_sysconfig_pre virtsecretd %libvirt_sysconfig_pre virtsecretd
%post daemon-driver-secret %post daemon-driver-secret
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtsecretd %libvirt_daemon_systemd_post virtsecretd
%endif
%libvirt_daemon_schedule_restart virtsecretd %libvirt_daemon_schedule_restart virtsecretd
%posttrans daemon-driver-secret %posttrans daemon-driver-secret
@ -1694,9 +1680,7 @@ fi
%libvirt_sysconfig_pre virtstoraged %libvirt_sysconfig_pre virtstoraged
%post daemon-driver-storage-core %post daemon-driver-storage-core
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtstoraged %libvirt_daemon_systemd_post virtstoraged
%endif
%libvirt_daemon_schedule_restart virtstoraged %libvirt_daemon_schedule_restart virtstoraged
%posttrans daemon-driver-storage-core %posttrans daemon-driver-storage-core
@ -1724,9 +1708,7 @@ fi
exit 0 exit 0
%post daemon-driver-qemu %post daemon-driver-qemu
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtqemud %libvirt_daemon_systemd_post virtqemud
%endif
%libvirt_daemon_schedule_restart virtqemud %libvirt_daemon_schedule_restart virtqemud
%posttrans daemon-driver-qemu %posttrans daemon-driver-qemu
@ -1742,9 +1724,7 @@ exit 0
%libvirt_sysconfig_pre virtlxcd %libvirt_sysconfig_pre virtlxcd
%post daemon-driver-lxc %post daemon-driver-lxc
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtlxcd %libvirt_daemon_systemd_post virtlxcd
%endif
%libvirt_daemon_schedule_restart virtlxcd %libvirt_daemon_schedule_restart virtlxcd
%posttrans daemon-driver-lxc %posttrans daemon-driver-lxc
@ -1760,9 +1740,7 @@ exit 0
%libvirt_sysconfig_pre virtvboxd %libvirt_sysconfig_pre virtvboxd
%post daemon-driver-vbox %post daemon-driver-vbox
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtvboxd %libvirt_daemon_systemd_post virtvboxd
%endif
%libvirt_daemon_schedule_restart virtvboxd %libvirt_daemon_schedule_restart virtvboxd
%posttrans daemon-driver-vbox %posttrans daemon-driver-vbox
@ -1778,9 +1756,7 @@ exit 0
%libvirt_sysconfig_pre virtxend %libvirt_sysconfig_pre virtxend
%post daemon-driver-libxl %post daemon-driver-libxl
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtxend %libvirt_daemon_systemd_post virtxend
%endif
%libvirt_daemon_schedule_restart virtxend %libvirt_daemon_schedule_restart virtxend
%posttrans daemon-driver-libxl %posttrans daemon-driver-libxl