X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=debian%2Fcinder-common.postinst;h=8045dbffb5afd52d18908d4bfcddf3470f23fd55;hb=d64a3a5bfc7f1c1fc7c9f139eb8b4f5be7cf229b;hp=3443c56fa6c0aadeccfadde7b0088cb12e87d0c8;hpb=bf2e44f60d8dc309f7724c0b6841d4edd090968d;p=openstack-build%2Fcinder-build.git diff --git a/debian/cinder-common.postinst b/debian/cinder-common.postinst index 3443c56fa..8045dbffb 100644 --- a/debian/cinder-common.postinst +++ b/debian/cinder-common.postinst @@ -1,11 +1,11 @@ #!/bin/sh -e if [ "$1" = "configure" ]; then - if ! getenv group cinder > /dev/null 2>&1; then + if ! getent group cinder > /dev/null 2>&1; then addgroup --system cinder >/dev/null fi - if ! getenv passwd cinder > /dev/null 2>&1; then + if ! getent passwd cinder > /dev/null 2>&1; then adduser --system --home /var/lib/cinder --ingroup cinder --no-create-home \ --shell /bin/false cinder fi @@ -19,7 +19,8 @@ if [ "$1" = "configure" ]; then chmod 0755 /etc/cinder/rootwrap.d chown root:root /etc/cinder/rootwrap.conf - if ! grep -q sql_connection /etc/cinder/cinder.conf + if ! grep -qE "^(sql_)?connection.*" /etc/cinder/cinder.conf || \ + grep -qE "^(sql_)?connection.*sqlite.*" /etc/cinder/cinder.conf then su -s /bin/sh -c 'cinder-manage db sync' cinder fi