Creates the correct libvirt group if the package is installed in Ubuntu.
[openstack-build/ceilometer-build.git] / xenial / debian / ceilometer-common.postinst.in
index aa927b09b851ee07a08848d89fcf935cb43acd9b..e4f3dafd60e30e88ac599ee4c1ea278c872176d2 100644 (file)
@@ -6,8 +6,14 @@ set -e
 
 # We need to do that for ceilometer-agent-compute
 libvirt_user_group () {
+       if dpkg-vendor --derives-from ubuntu ; then
+               LIBVIRT_GROUP=libvirtd
+       else
+               LIBVIRT_GROUP=libvirt
+       fi
+
        if ! getent group libvirt >/dev/null; then
-               addgroup --system libvirt
+               addgroup --system ${LIBVIRT_GROUP}
        fi
 
        # user and group libvirt runs qemu/kvm instances with