[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, experimental, updated. debian/0.7.4-1-2-g19bd427

Guido Günther agx at sigxcpu.org
Sat Dec 5 17:37:03 UTC 2009


The following commit has been merged in the experimental branch:
commit 19bd4279cab3bb32b0175770c4a6395155fa7107
Author: Guido Günther <agx at sigxcpu.org>
Date:   Mon Nov 30 06:16:35 2009 +0100

    Run qemu instances as qemu-libvirt instead of root by default

diff --git a/debian/libvirt-bin.postinst b/debian/libvirt-bin.postinst
index 51998a3..fae859d 100644
--- a/debian/libvirt-bin.postinst
+++ b/debian/libvirt-bin.postinst
@@ -24,6 +24,25 @@ case "$1" in
     		addgroup --system libvirt
 	fi
 
+	# user and group libvirt runs qemu/kvm instances with
+	if ! getent group libvirt-qemu >/dev/null; then
+		addgroup --system libvirt-qemu
+	fi
+	if ! getent passwd libvirt-qemu >/dev/null; then
+		adduser --system \
+			--ingroup libvirt-qemu \
+			--quiet \
+			--disabled-login \
+			--disabled-password \
+                        --home /var/lib/libvirt \
+                        --no-create-home \
+			-gecos "Libvirt Qemu" \
+			libvirt-qemu
+		if getent group kvm >/dev/null; then
+			adduser libvirt-qemu kvm
+		fi
+	fi
+
 	# libvirt from 0.6.0 on is safe to restart with running vms:
 	if [ -n "$2" ] &&  dpkg --compare-versions "$2" ge 0.6.0; then
 	    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
diff --git a/debian/rules b/debian/rules
index 3d28d28..d33dae9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -24,6 +24,8 @@ include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 DEB_CONFIGURE_EXTRA_FLAGS :=     \
 	--disable-rpath          \
 	--with-qemu              \
+	--with-qemu-user=libvirt-qemu  \
+	--with-qemu-group=libvirt-qemu \
 	--with-openvz            \
 	--with-avahi             \
 	--with-sasl              \

-- 
Libvirt Debian packaging



More information about the Pkg-libvirt-commits mailing list