From de798baff8dfb642e0c956d8869da813a0e2c96b0c0e2d87df2c7c3f875700cc Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 1 Jul 2011 16:05:42 +0000 Subject: [PATCH] Create qemu user:group if necessary at package installation OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=130 --- libvirt.changes | 6 ++++++ libvirt.spec | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/libvirt.changes b/libvirt.changes index a37f693..bdb1cf3 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -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 diff --git a/libvirt.spec b/libvirt.spec index ce5bcd4..2328b84 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -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}