This file is indexed.

postinst is in nova-common 1:2014.1.5-0ubuntu1.7.

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
69
70
71
72
73
74
75
#!/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 {} \;
    elif dpkg --compare-versions "$2" lt "2012.2~f1~20120503.13935-0ubuntu1"; then
	  # convert the root_helper to rootwrap_config
	  sed -e "s,^root_helper=.\+,rootwrap_config=/etc/nova/rootwrap.conf," -i /etc/nova/nova.conf
    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 /etc/nova
    chown -R nova:adm /var/log/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 0640 /etc/nova/nova.conf
    chmod 0640 /etc/nova/policy.json
    chmod 0640 /etc/nova/api-paste.ini
    chmod 0750 /etc/nova
    chmod 0750 /var/log/nova
    chown root:root /etc/nova/rootwrap.conf
    chown root:root /etc/nova/rootwrap.d
    chmod 0755 /etc/nova/rootwrap.d

    if ! grep -qE "^(sql_)?connection( )?=.*" /etc/nova/nova.conf || \
         grep -qE "^(sql_)?connection.*sqlite.*" /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 0640 /var/lib/nova/nova.sqlite
    fi

fi