]> review.fuel-infra Code Review - openstack-build/cinder-build.git/blob - trusty/debian/cinder-common.postinst
Add cinder 2015.1 for Kilo
[openstack-build/cinder-build.git] / trusty / debian / cinder-common.postinst
1 #!/bin/sh -e
2
3 if [ "$1" = "configure" ]; then
4     if ! getent group cinder > /dev/null 2>&1; then
5         addgroup --system cinder >/dev/null
6     fi
7
8     if ! getent passwd cinder > /dev/null 2>&1; then
9         adduser --system --home /var/lib/cinder --ingroup cinder --no-create-home \
10             --shell /bin/false cinder
11     fi
12
13     chown -R cinder:adm /var/log/cinder
14     chmod 0750 /var/log/cinder
15     chown -R cinder:cinder /var/lib/cinder /etc/cinder
16     chmod 0750 /etc/cinder
17     chmod 0440 /etc/sudoers.d/cinder_sudoers
18     chown -R root:root /etc/cinder/rootwrap.d
19     chmod 0755 /etc/cinder/rootwrap.d
20     chown root:root /etc/cinder/rootwrap.conf
21
22     if ! grep -qE "^(sql_)?connection.*" /etc/cinder/cinder.conf || \
23          grep -qE "^(sql_)?connection.*sqlite.*" /etc/cinder/cinder.conf
24     then
25         su -s /bin/sh -c 'cinder-manage db sync' cinder
26     fi
27
28     if [ -e /var/lib/cinder/cinder.sqlite ]; then
29         chown cinder:cinder /var/lib/cinder/cinder.sqlite
30         chmod 0600 /var/lib/cinder/cinder.sqlite
31     fi
32 fi
33
34 #DEBHELPER#