3 if [ "$1" = "configure" ]; then
4 if ! getent group cinder > /dev/null 2>&1; then
5 addgroup --system cinder >/dev/null
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
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
22 if ! grep -qE "^(sql_)?connection.*" /etc/cinder/cinder.conf || \
23 grep -qE "^(sql_)?connection.*sqlite.*" /etc/cinder/cinder.conf
25 su -s /bin/sh -c 'cinder-manage db sync' cinder
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