Create qemu user:group if necessary at package installation

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=130
This commit is contained in:
James Fehlig 2011-07-01 16:05:42 +00:00 committed by Git OBS Bridge
parent cda650a7d1
commit de798baff8
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 1 10:10:23 MDT 2011 - jfehlig@suse.de
- Create qemu user:group if necessary at package installation.
More fallout from bnc#694883
-------------------------------------------------------------------
Thu Jun 30 14:48:51 MDT 2011 - jfehlig@suse.de

View File

@ -707,6 +707,15 @@ then
< %{_datadir}/libvirt/networks/default.xml \
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
fi
# Create qemu user:group if necessary
if test "%{qemu_user}" = "qemu"; then
%{_bindir}/getent group qemu >/dev/null || \
%{_sbindir}/groupadd -r qemu 2>/dev/null
%{_bindir}/getent group kvm >/dev/null && group_opts="-G kvm"
%{_bindir}/getent passwd qemu >/dev/null || \
%{_sbindir}/useradd -r -g qemu $group_opts -d / -s /sbin/nologin \
-c "qemu user" qemu
fi
%endif
%if 0%{?sles_version}
%{fillup_and_insserv -y libvirtd}