rpm: don't start/stop -ro.socket units for virtlockd/virtlogd

These daemons do not have any support for unprivileged readonly
access, so we must not reference -ro.socket units in scripts.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-12-14 16:21:44 +00:00
parent 25a6e49668
commit 883f643d70

View File

@ -1277,14 +1277,18 @@ then \
fi \ fi \
%libvirt_daemon_finish_restart %1 %libvirt_daemon_finish_restart %1
# For daemons with only UNIX sockets
%define libvirt_daemon_systemd_post() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1.service %define libvirt_daemon_systemd_post() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1.service
%define libvirt_daemon_systemd_post_inet() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.service
%define libvirt_daemon_systemd_preun() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1.socket %define libvirt_daemon_systemd_preun() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1.socket
# For daemons with UNIX and INET sockets
%define libvirt_daemon_systemd_post_inet() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.service
%define libvirt_daemon_systemd_preun_inet() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.socket %define libvirt_daemon_systemd_preun_inet() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.socket
# For daemons with only UNIX sockets and no unprivileged read-only access
%define libvirt_daemon_systemd_post_priv() %systemd_post %1.socket %1-admin.socket %1.service
%define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket
%pre daemon %pre daemon
# 'libvirt' group is just to allow password-less polkit access to # 'libvirt' group is just to allow password-less polkit access to
# libvirtd. The uid number is irrelevant, so we use dynamic allocation # libvirtd. The uid number is irrelevant, so we use dynamic allocation
@ -1294,8 +1298,8 @@ getent group libvirt >/dev/null || groupadd -r libvirt
exit 0 exit 0
%post daemon %post daemon
%libvirt_daemon_systemd_post virtlogd %libvirt_daemon_systemd_post_priv virtlogd
%libvirt_daemon_systemd_post virtlockd %libvirt_daemon_systemd_post_priv virtlockd
%if %{with_modular_daemons} %if %{with_modular_daemons}
%libvirt_daemon_systemd_post_inet virtproxyd %libvirt_daemon_systemd_post_inet virtproxyd
%else %else
@ -1311,8 +1315,8 @@ exit 0
%libvirt_daemon_systemd_preun_inet libvirtd %libvirt_daemon_systemd_preun_inet libvirtd
%libvirt_daemon_systemd_preun_inet virtproxyd %libvirt_daemon_systemd_preun_inet virtproxyd
%libvirt_daemon_systemd_preun virtlogd %libvirt_daemon_systemd_preun_priv virtlogd
%libvirt_daemon_systemd_preun virtlockd %libvirt_daemon_systemd_preun_priv virtlockd
%postun daemon %postun daemon
/bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || :