mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
42cbffd715
commit
4ed8f5b67d
@ -1466,6 +1466,21 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%if %{with_qemu}
|
%if %{with_qemu}
|
||||||
|
%pre daemon-driver-qemu
|
||||||
|
# We want soft static allocation of well-known ids, as disk images
|
||||||
|
# are commonly shared across NFS mounts by id rather than name; see
|
||||||
|
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
|
||||||
|
getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
|
||||||
|
getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
|
||||||
|
if ! getent passwd qemu >/dev/null; then
|
||||||
|
if ! getent passwd 107 >/dev/null; then
|
||||||
|
useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
||||||
|
else
|
||||||
|
useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
%post daemon-driver-qemu
|
%post daemon-driver-qemu
|
||||||
%if %{with_modular_daemons}
|
%if %{with_modular_daemons}
|
||||||
%libvirt_daemon_systemd_post virtqemud
|
%libvirt_daemon_systemd_post virtqemud
|
||||||
@ -1587,23 +1602,6 @@ done
|
|||||||
%libvirt_daemon_perform_restart libvirtd
|
%libvirt_daemon_perform_restart libvirtd
|
||||||
%libvirt_daemon_perform_restart virtnwfilterd
|
%libvirt_daemon_perform_restart virtnwfilterd
|
||||||
|
|
||||||
%if %{with_qemu}
|
|
||||||
%pre daemon-driver-qemu
|
|
||||||
# We want soft static allocation of well-known ids, as disk images
|
|
||||||
# are commonly shared across NFS mounts by id rather than name; see
|
|
||||||
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
|
|
||||||
getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
|
|
||||||
getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
|
|
||||||
if ! getent passwd qemu >/dev/null; then
|
|
||||||
if ! getent passwd 107 >/dev/null; then
|
|
||||||
useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
|
||||||
else
|
|
||||||
useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{with_lxc}
|
%if %{with_lxc}
|
||||||
%pre login-shell
|
%pre login-shell
|
||||||
getent group virtlogin >/dev/null || groupadd -r virtlogin
|
getent group virtlogin >/dev/null || groupadd -r virtlogin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user