postinst is in nova-common 2:17.0.1-0ubuntu1.
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 | #!/bin/sh -e
NOVA_UID=64060
NOVA_GID=64060
if [ "$1" = "configure" ]; then
if ! getent group nova > /dev/null 2>&1; then
addgroup --quiet --system \
--gid $NOVA_GID nova 2>/dev/null
fi
if ! getent passwd nova > /dev/null 2>&1; then
adduser --quiet --system \
--home /var/lib/nova \
--no-create-home \
--uid $NOVA_UID \
--gid $NOVA_GID \
--shell /bin/false nova 2>/dev/null
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
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/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 [ -e /var/lib/nova/nova.sqlite ]
then
chown nova:nova /var/lib/nova/nova.sqlite
chmod 0640 /var/lib/nova/nova.sqlite
fi
if [ -e /var/lib/nova/nova_api.sqlite ]
then
chown nova:nova /var/lib/nova/nova_api.sqlite
chmod 0640 /var/lib/nova/nova_api.sqlite
fi
fi
|