~cisco-openstack/glance/ubuntu-ng

« back to all changes in this revision

Viewing changes to debian/glance.postinst

  • Committer: Chuck Short
  • Date: 2011-12-07 19:21:02 UTC
  • mfrom: (68.2.2 merge-from-ubuntu)
  • Revision ID: zulcss@ubuntu.com-20111207192102-21pbpajguqly5li7
* debian/glance.postinst: Add glance group and add glance user to it.
  (LP: #851860)
* Only remove user/group in .postrm if they exist. (LP: #857021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
if [ "$1" = "configure" ]
6
6
then
 
7
        if ! getent group glance > /dev/null 2>&1
 
8
        then
 
9
                addgroup --system glance >/dev/null
 
10
        fi
7
11
        if ! getent passwd glance > /dev/null 2>&1
8
12
        then
9
 
        adduser --system --home /var/lib/glance --no-create-home --shell /bin/bash glance
 
13
        adduser --system --home /var/lib/glance --ingroup glance --no-create-home --shell /bin/bash glance
10
14
        fi
11
 
        chown glance -R /var/lib/glance/ /var/log/glance/
 
15
        chown glance:glance -R /var/lib/glance/ /var/log/glance/
12
16
        if ! grep sql_connection /etc/glance/glance-registry.conf | grep -qv "sql_connection = sqlite:////var/lib/glance/glance.sqlite"
13
17
        then
14
18
                su -c 'glance-manage db_sync' glance