This file is indexed.

postinst is in nova-common 2012.1-0ubuntu2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh -e

if [ "$1" = "configure" ]; then
    if ! getent group nova > /dev/null 2>&1; then
        addgroup --system nova >/dev/null
    fi

    if ! getent passwd nova > /dev/null 2>&1; then
        adduser --system --home /var/lib/nova --ingroup nova --no-create-home --shell /bin/false nova
    fi

    if [ "$(id -gn nova)"  = "nogroup" ]; then
      usermod -g nova nova
    fi

    if [ -z "$2" ]; then
      # New install - blanket permissions
      chown -R nova:nova /var/lib/nova/
    elif dpkg --compare-versions "$2" lt "2011.3-0ubuntu4"; then
      # make sure that LXC rootfs mount points are excleuded
      # during upgrades from previous versions
      find /var/lib/nova/ -name 'rootfs' -prune -o \
        -group root -a -user nova -exec chown nova:nova {} \;
      find /var/lib/nova/ -name 'rootfs' -prune -o \
        -group nogroup -a -user nova -exec chown nova:nova {} \;
    fi	

    if [ "$(id -gn nova)"  = "nogroup" ]; then
        usermod -g nova nova
    fi

    if dpkg --compare-versions "$2" lt "2012.1~e3-0ubuntu2"; then
      usermod -s "/bin/false" nova
    fi

    chown -R nova:nova /var/log/nova/ /etc/nova/

    if [ -z "$2" ]; then
        # New install - blanket permissions
        chown -R nova:nova /var/lib/nova/
    elif dpkg --compare-versions "$2" lt "2011.3-0ubuntu4"; then
        # Make sure the LXC rootfs mount points are excluded
        # during upgrades from previous versions
        find /var/lib/nova/ -name 'rootfs' -prune -o \
           -group root -a -user nova -exec chown nova:nova {} \;
        find /var/lib/nova/ -name 'rootfs' -prune -o \
           -group nogroup -a -user nova -exec chown nova:nova {} \;
    fi

    chmod 0600 /etc/nova/nova.conf
    chmod 0600 /etc/nova/policy.json
    chmod 0600 /etc/nova/api-paste.ini
    chmod 0700 /etc/nova
    chmod 0440 /etc/sudoers.d/nova_sudoers
    chmod 0700 /var/log/nova

    if ! grep -q sql_connection /etc/nova/nova.conf
    then
      su -s /bin/sh -c 'nova-manage db sync' nova
    fi

    if [ -e /var/lib/nova/nova.sqlite ]
    then
      chown nova:nova /var/lib/nova/nova.sqlite
      chmod 0600 /var/lib/nova/nova.sqlite
    fi

fi