X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=trusty%2Fdebian%2Fceilometer-common.postinst.in;h=8b26aa0aea6157c10a6fd2c3b6772703d9ea6990;hb=eb5f2168e8fb8a09c2d3fa9e273df078dd0dac81;hp=5155a5871d2897dbc0c0fc0290f74da59ffda84c;hpb=15dfed28a3384c2bbd322e9b33a86ead9a5c9b26;p=openstack-build%2Fceilometer-build.git diff --git a/trusty/debian/ceilometer-common.postinst.in b/trusty/debian/ceilometer-common.postinst.in index 5155a58..8b26aa0 100644 --- a/trusty/debian/ceilometer-common.postinst.in +++ b/trusty/debian/ceilometer-common.postinst.in @@ -4,14 +4,50 @@ set -e #PKGOS-INCLUDE# -if [ "$1" = "configure" ]; then - pkgos_var_user_group nova +# 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_GROUP} + fi + + # user and group libvirt runs qemu/kvm instances with + if ! getent group kvm >/dev/null; then + addgroup --quiet --system kvm + fi + if ! getent passwd libvirt-qemu >/dev/null; then + adduser --quiet \ + --system \ + --ingroup kvm \ + --quiet \ + --disabled-login \ + --disabled-password \ + --home /var/lib/libvirt \ + --no-create-home \ + -gecos "Libvirt Qemu" \ + libvirt-qemu + fi +} + +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then + . /usr/share/debconf/confmodule + pkgos_adduser nova pkgos_var_user_group ceilometer + libvirt_user_group adduser ceilometer nova || true + adduser ceilometer libvirt || true pkgos_write_new_conf ceilometer ceilometer.conf pkgos_write_new_conf ceilometer policy.json pkgos_write_new_conf ceilometer sources.json - /usr/bin/ceilometer-dbsync + pkgos_write_new_conf ceilometer pipeline.yaml + pkgos_rabbit_write_conf /etc/ceilometer/ceilometer.conf DEFAULT ceilometer + pkgos_write_admin_creds /etc/ceilometer/ceilometer.conf keystone_authtoken ceilometer + ceilometer-dbsync || true fi #DEBHELPER#